Solved

Can auto-increment in Excel autofill be disabled?

Posted on 2010-09-23
10
2,357 Views
Last Modified: 2012-05-10
Hi,

I have a column of numbers that I sometimes need to copy down to fill blanks. i use the Autofill feature, however it starts automatically doing fill series, and instead of copying the number it increments by 1. Then I have to click the euotfill options thingy that comes up and choose 'copy cells'. Supremely annoying.

Is there a way to disable this (just for this workbook/sheet/column - i.e. if I email it to someone, it will not do this in their excel either)? Perhaps a different number format? I tried changing the number format to text, but it still does it!

Any help greatly appreciated! Thank you!

Andrey
0
Comment
Question by:andreyman3d2k
  • 5
  • 5
10 Comments
 
LVL 24

Expert Comment

by:broomee9
ID: 33745130
The auto-complete feature is an application wide setting and cannot be turned off for one workbook by Excel settings.  You would have to use VBA to do it.  If that's something you want, let me know.
0
 
LVL 24

Expert Comment

by:broomee9
ID: 33745161
Below is the VBA, in case you do want to go that route.  The code would go into the ThisWorkbook module.  And it would disable Auto-complete for the entire application once the below workbook is opened.  Then before it's closed, it gets re-enabled.


Private Sub Workbook_BeforeClose(Cancel As Boolean)
    Application.EnableAutoComplete = True
End Sub

Private Sub Workbook_Open()
    Application.EnableAutoComplete = False
End Sub

Open in new window

Book1.xls
0
 
LVL 6

Author Comment

by:andreyman3d2k
ID: 33745229
Unless I misunderstood your answer, I think we are talking about different things. I am talking about the auto-fill, not the auto-complete. I.e. where you can pull down the corner of the selected cell, and it copies the contents (or, as in my case, annoyingly increments it by one each time). Will your code disable this auto-incrementing? I still want to use the auto-fill, just not have it increment.

Thanks,

Andrey
0
 
LVL 6

Author Comment

by:andreyman3d2k
ID: 33745256
Here is an example of the number I am talking about:

US.NMH.09.03.015

if you place that into a cell then use the auto-fill to copy down, you will get

US.NMH.09.03.015
US.NMH.09.03.016
US.NMH.09.03.017
US.NMH.09.03.018

I want to get

US.NMH.09.03.015
US.NMH.09.03.015
US.NMH.09.03.015
US.NMH.09.03.015

without having to click that 'Autofill Options' icon that comes up
0
 
LVL 24

Accepted Solution

by:
broomee9 earned 500 total points
ID: 33745366
OK, I get what you're saying now.

To stop the autofill from incrementing, when you're dragging it down, hold the ctrl key, and then let go of the mouse.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 24

Expert Comment

by:broomee9
ID: 33745402
Alternatively, instead of using the fill handle, you can select your cell and all the cells below you want filled and press Ctrl + D and this will fill in the range with the value of the first cell highlighted.
0
 
LVL 6

Author Comment

by:andreyman3d2k
ID: 33745518
Thanks! Will the ctrl(or cmd)-drag work on Mac Office 2008?
0
 
LVL 24

Expert Comment

by:broomee9
ID: 33745652
According to this the Ctrl + D will work for Mac Office:

http://www.tongfamily.com/archives/2008/09/mac-excel-shortcuts/

I've never used a Mac though, so I can't say for sure.
0
 
LVL 6

Author Comment

by:andreyman3d2k
ID: 33745712
I just got a hold of a mac and tested it -- Option+drag works.

Thanks for your help!
0
 
LVL 6

Author Closing Comment

by:andreyman3d2k
ID: 33745721
Awesome, thank you.

Andrey
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
Workbook link problems after copying tabs to a new workbook? David Miller (dlmille) Intro Have you either copied sheets to a new workbook, and after having saved and opened that workbook, you find that there are links back to the original sou…
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now