How to tame Excel Calculate

eros

Board Regular
Joined
May 6, 2011
Messages
90
Hi everyone,

I am having trouble in controlling the time needed to update my Excel 2010 file through VBA macro.

My VBA macro runs a constant block of instructions in order to copy new data from an external file and integrate with the existing data in my Excel file. My VBA macro briefly add formulas and values to cells, inserts, deletes, cuts, copies, pastes, hides, unhides, vlookups and links cells, columns and rows as well as it inserts and rename new sheets for new data, all on the fly.

Even though I make sure that I set Automatic Update to "Manual" and Screen Update to "Off", while the file gets larger due to new data added through my VBA macro, it takes longer for my VBA macro to complete the standard operations above. The exact amount of VBA code executed and new data added on each run stay unchanged; therefore, I would expect my macro run time should be constant as I have already switched off any likely additional time consuming operations due to the increased size of the Excel file.

In my macro, I merely run Calculate for specific range of cells, for those that I cannot let stay unchanged after new data retrieval.

I suspect, all or part of the operations listed above cause Excel to calculate the whole file.

How can I truely be sure that I switch off automatic calculation and prevent Excel from losing time while it runs my VBA macro. I want Excel just to accept new data, organize the file as per the VBA macro but not calculate anything -except for several cells I intentionally address to calculate thorough "Range.Calculate"?

Many thanks in advance.
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
Let me add for you guys to see the reasoning:

Why I opt to suspend calculate is that after inserting new data, it truely might be very time consuming for Excel to calculate the whole workbook due to large amount of cell links and conditional formatting.

Many thanks again.
 
Upvote 0

Forum statistics

Threads
1,223,227
Messages
6,170,853
Members
452,361
Latest member
d3ad3y3

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