Pause in a macro

D

Darren

I have a series of sheets that uses a button on sheet 1 to refresh all the
data in the other sheets. I then press another button, again on sheet 1 do
the preset calculations to each sheet using a self written macro. What I want
to know is, is it possible to write a pause into a macro that will last long
enough for all the refreshing to finish before the calculations start? The
refresh usually takes about 90 seconds but this is variable according to
connection speed and time of day, etc...
 
J

JLGWhiz

This will give you a 90 second pause in the macro while allowing all other
events to continue.

s = Timer + 90
Do While Timer < s
DoEvents
Loop
 
D

Darren

This is my macro:
Application.Run "Monthly_Reset_A_C"
Application.Run "Monthly_Reset_D_M"
Application.Run "Monthly_Reset_N_Z"

I want to insert: Application.Run "Refresh" to refresh all the sheets before
they get reset for the monthly figure. Doing what you explained only puts a
90 second pause before it runs the monthly reset applications, which still
run before the refresh. Where do I put your snippet to make it run in the
correct order?
 

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