Please Note: This article is written for users of the following Microsoft Excel versions: 2007, 2010, 2013, and 2016. If you are using an earlier version (Excel 2003 or earlier), this tip may not work for you. For a version of this tip written specifically for earlier versions of Excel, click here: Turning Off AutoFill for a Workbook.
by Allen Wyatt
(last updated June 23, 2018)
The AutoFill feature of Excel can be a great timesaver when entering information. However, you may want to disable the feature for a particular workbook; perhaps you don't want the feature to be used by anyone using your workbook. Doing so is easy if you create a macro that can recognize when you are working with that particular workbook.
To turn off the AutoFill feature for a particular workbook, follow these steps:
Private Sub Workbook_Activate() Application.CellDragAndDrop = False End Sub
Private Sub Workbook_Deactivate() Application.CellDragAndDrop = True End Sub
The first macro is only run when the particular workbook is activated. In other words, when the workbook attains focus or is selected. When a different workbook attains focus, then the second macro is executed.
ExcelTips is your source for cost-effective Microsoft Excel training. This tip (11197) applies to Microsoft Excel 2007, 2010, 2013, and 2016. You can find a version of this tip for the older menu interface of Excel here: Turning Off AutoFill for a Workbook.
Program Successfully in Excel! John Walkenbach's name is synonymous with excellence in deciphering complex technical topics. With this comprehensive guide, "Mr. Spreadsheet" shows how to maximize your Excel experience using professional spreadsheet application development tips from his own personal bookshelf. Check out Excel 2013 Power Programming with VBA today!
The AutoFill feature can be used for more than just incrementing information into cells. This tip explains how to access ...Discover More
Want to fill a long column with predictive data? It's easy to do by using AutoFill and a double-click of the mouse.Discover More
Need to fill a range of cells with the days of the week? Excel makes it easy to do so using AutoFill.Discover More
FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu interface.