Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 59
Default 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   Report Post  
Posted to microsoft.public.excel.programming
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,



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 59
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Count backwards with a for next loop Gus Chuch Excel Programming 3 November 26th 07 07:56 PM
Loop & Count Paul Black Excel Programming 9 January 14th 07 10:54 PM
Loop & Count Paul Black[_2_] Excel Programming 0 January 4th 07 07:24 AM
loop count TUNGANA KURMA RAJU Excel Discussion (Misc queries) 2 October 1st 05 04:54 AM


All times are GMT +1. The time now is 04:28 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"