Prevent Autofill of Formulas in Excel Tables w/VBA

Randall00

Board Regular
Joined
Jan 31, 2008
Messages
54
Hello,

I've looked for a solution to a problem I'm experiencing in a variety of places and just can't quite seem to get the one I'm looking for. I feel like it should be pretty simple.

I have a series of nearly identical sheets that each have multiple Tables (ListObjects) - they all have a Header Row and the row directly below the header has an absolute SUM formula that sums up the values in the three rows directly below itself.

The problem is that in order to "reset" these tables to their default state for a user of the spreadsheet, I've created a VBA procedure that uses code to populate the SUM formula in that specific cell below the header in each of these tables--but each time I run it, Excel automatically fills the formula in on all of the rows in that Table, which creates a series of circular references that I do not want.

For the life of me, I can't figure out how to prevent this. There's a lot of promising options out there, but most of them just don't quite do it. I have already tried the following:
  • Application.CellDragAndDrop = False
  • Application.ExtendList = False
  • Application.EnableAutoComplete = False

None of these seem t work. "AutoComplete" isn't the function I was looking for. "ExtendList" sounded very hopeful because it references the checkbox provided in Excel Options that says "extend data range formats and formulas", but whether that box is checked or not, the formula still gets automatically filled down the entire table.

How can I prevent Excel from doing this?
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
There's a setting under Office Button|Excel Options|Proofing|AutoCorrect Options. On the AutoFormat As You Type tab uncheck 'Fill Formulas In Tables To Create Calculated Columns'. Sorry I don't kno what it is in VBA but maybe the macro recorder will give you the syntax.
 
Upvote 0
Solved!

Thanks very much, Andrew--I'm surprised that the recorder picked it up from such an obscure location, but luckily it did:

Code:
Application.AutoCorrect.AutoFillFormulasInLists = False
 
Upvote 1
Solved!

Thanks very much, Andrew--I'm surprised that the recorder picked it up from such an obscure location, but luckily it did:

Code:
Application.AutoCorrect.AutoFillFormulasInLists = False
An old post but exactly what I was looking for!
 
Upvote 0

Forum statistics

Threads
1,215,221
Messages
6,123,701
Members
449,117
Latest member
Aaagu

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top