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.
 

Some videos you may like

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.

Jeffrey Mahoney

Well-known Member
Joined
May 31, 2015
Messages
1,830
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
 

Watch MrExcel Video

Forum statistics

Threads
1,122,370
Messages
5,595,764
Members
414,017
Latest member
surajks

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