how to determine calculation setting?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is there a way to determine the calculation setting of Excel from within a
macro?

I write a lot of macros that turn off calculation so they'll run faster,
then turn it back on at the end.

Now I'm dealing with workbooks where automatic calculation is already turned
off, and for those I don't WANT it turned on at the end.

Is there a way to tell what the setting is so that I can set it back the way
it was when the macro's done?
 
save the calculation setting before changing it to manual, then set it back
to the original setting at the end.

Sub test()
Dim lngCalc As Long

lngCalc = Application.Calculation
Application.Calculation = xlCalculationManual

'your code here

Application.Calculation = lngCalc
End Sub
 
Back
Top