Turn off Autocalculate in VBE/VBScript

  • Thread starter Thread starter Michael
  • Start date Start date
M

Michael

I have a spreadsheet that sucks in a bunch of text files
and runs some calculations against it. It works great but
now that it's getting a little large it is taking longer
and longer to run. What appears to be happening is that
the Autocalculation is running each time I update a cell,
which is often. I can see the "Calculating Cells: xx%" in
the bottom left of the Excel screen. How do I turn this
off within my script and then turn it on again once I'm
done?
 
Hi Michael
try the following

Sub foo()
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
'...
'enter your code
'...
Application.ScreenUpdating = True
Application.Calculation = xlCalculationAutomatic
end sub
 
THANKS!



-----Original Message-----
Hi Michael
try the following

Sub foo()
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
'...
'enter your code
'...
Application.ScreenUpdating = True
Application.Calculation = xlCalculationAutomatic
end sub


--
Regards
Frank Kabel
Frankfurt, Germany

.
 

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

Back
Top