how to determine calculation setting?

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?
 
G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top