Thread: Count Down Loop
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Patrick Molloy Patrick Molloy is offline
external usenet poster
 
Posts: 1,049
Default Count Down Loop

Dim t As Double
t = Timer
Do
diff = Timer - t
Application.StatusBar = Int(120 - diff)
DoEvents
Loop While diff < 120 'seconds

"Charlotte E" <@ wrote in message
...
This should be easy, but somehow, I can't get the hang of it ... :-/

I need to have a macro pause for 2 minutes, but I need the user to know
how much more to wait.


So, I figured I wanted to make a loop that shows the remaing time it the
statusbar, i.e. something like:

Application.statusbar = "Waiting for data collecting: 00:02:00"

and then it should proceed to:

Application.statusbar = "Waiting for data collecting: 00:01:59"

Etc...

And of cause, when the time was up, the macro should continue :-)


I'm not sure if 2 minutes are gonna be enough for the ERP system to finish
up, so my macro can continue, so some way of easy althering the time
(maybe by using a constant for the time) would also be apriciated :-)


TIA,