a trick to speed things up

mhume

New Member
Joined
May 30, 2008
Messages
4
Not sure if this is common sense or not, but considering my excel macro's have gotten rather monstrous lately I started using a trick to speed things up.

' put this at the top of your code
Application.Calculation = xlManual

' put this at the end of your code
Application.Calculation = xlAutomatic
Calculate

For all my routines that manipulate formulas in my worksheets, I have seen HUGE reductions in load time from doing this. In some cases, from a couple minutes down to a few seconds. I think this trick is pretty much mandatory for any complex spreadsheet manipulations.

Just thought I'd share.
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
This method is common practice along with others.

Another one is to turn off screen updating.
Code:
Application.ScreenUpdating = False
   ' rest of code
Application.ScreenUpdating = True
If your code has become 'monstrous' then it might be time to take a good look at it and see if it can be optimized/cleaned up.

How exactly that would be done is hard to tell without seeing the code or a sample of it.

And an explanation of the code's purpose wouldn't go amiss either.:)
 
Upvote 0

Forum statistics

Threads
1,216,069
Messages
6,128,600
Members
449,460
Latest member
jgharbawi

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