Good idea to disable Automatic calculations in VBA?

Karthik-Excelsior

Active Member
Joined
Mar 4, 2011
Messages
313
Hi Excel gurus,

I've a huge template where I'm adding a couple macros - basically to copy-paste data across sheets. I realized that since the volume of data in the file is huge, even the macro is taking a lot of time to copy-paste.

But, when I try copy-pasting after disabling the 'Automatic Calculation' feature, it works in a second.

So, my question here is, is it a good idea to disable auto calc before executing this event & turning it on after?

Something like..

ThisWorkbook.Sheets("Summary").EnableCalculation = False

{code}

ThisWorkbook.Sheets("Summary").EnableCalculation = True

what are your thoughts here? Thanks!






 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
Best way to check if it makes a difference is to try it out...Generally speaking though you are going to have your calculation event fire when you set calculation back to true so it might just be putting it off.

Are the calculations you are doing necessary/what is taking so much time?
 
Upvote 0
Does your macro depend on "calculated results" for processing data?

I'm guessing it doesn't as you seem to be satisfied on both counts i.e. macro speed and results you got.

It is common in macros to disable some of the items which may affect the macro execution speed and then enable (without fail) / set them to default at the end of it.

See Kenneth Hobson's entry here which might be useful for you:
VBA Express : Excel - Speed Up Code
 
Upvote 0

Forum statistics

Threads
1,214,589
Messages
6,120,416
Members
448,960
Latest member
AKSMITH

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