AutoCalculation Question

dturgel

Board Regular
Joined
Aug 6, 2015
Messages
58
I'm having a tough time speeding up a macro that runs through a very long sequence of steps. What's strange is when I switch excel to manual calculation, it flies through the macro in 4-5 seconds but when I switch the code to reflect this (i.e. put in xlCalculationManual in the first line of the code and xlCalculationAutomatic in the last line of the code) it is still really slow - does anyone know if it makes a difference where I put these commands in the code? Should I put them in multiple places within the code? Any ideas are greatly appreciated.
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN

Jeffrey Mahoney

Well-known Member
Joined
May 31, 2015
Messages
2,061
Office Version
  1. 365
Platform
  1. Windows
Hi dturgel

This should go at the very top: Application.Calculation = xlCalculationManual
This should go at the very bottom: Application.Calculation = xlCalculationAutomatic

If you are using nested subroutines, one of them may turn the calculation back to automatic before it comes back to the calling SUB. You'll need to look for that. I use them all the time and it works like you want.

Jeff
 

dturgel

Board Regular
Joined
Aug 6, 2015
Messages
58
Jeff,

Yes, I am using nested subroutines - I will turn them off in them and let you know how it goes - thanks so much for your advice!

Daniel
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,164,139
Messages
5,835,632
Members
430,372
Latest member
contentment

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
Top