Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Count Down Loop
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, |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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, |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Count Down Loop
Perfect :-)
Thanks, PaTRICK ;-) Patrick Molloy wrote: 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, |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Count backwards with a for next loop | Excel Programming | |||
Loop & Count | Excel Programming | |||
Loop & Count | Excel Programming | |||
loop count | Excel Discussion (Misc queries) |