Toggling on/off auto calc

S

Secret Squirrel

How can I toggle on and off the automatic calculations in VBA code? I have a
code that imports data from another file but when I run this code I want to
be able to shut off the auto-calc until the import is done. How would I do
this?
 
J

Jim Rech

Try recording a macro as you perform the action manually. That's a good way
to start learning the Excel object model.

--
Jim
message | How can I toggle on and off the automatic calculations in VBA code? I have
a
| code that imports data from another file but when I run this code I want
to
| be able to shut off the auto-calc until the import is done. How would I do
| this?
 
G

Gord Dibben

Sub todostuff()

Application.Calculation = xlManual
your code here
Application.Calculation = xlAutomatic

End Sub
 
J

Jim Rech

If you give a man a fish you feed him for one day. If you teach him to fish
you feed him for a lifetime.

--
Jim
"Gord Dibben" <gorddibbATshawDOTca> wrote in message
| Sub todostuff()
|
| Application.Calculation = xlManual
| your code here
| Application.Calculation = xlAutomatic
|
| End Sub
|
| On Tue, 20 May 2008 07:20:01 -0700, Secret Squirrel
|
| >How can I toggle on and off the automatic calculations in VBA code? I
have a
| >code that imports data from another file but when I run this code I want
to
| >be able to shut off the auto-calc until the import is done. How would I
do
| >this?
|
 
G

Gord Dibben

Along with Excel help we are now dispensing homilies?<g>

But......point taken Jim


Gord
 

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