Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
how would I write a loop that would run until a certain time of day then
execute the rest of the macro. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Don't!
Use Ontime to execute another macro with the rest of the code in at the specified time. See Chip's page at http://www.cpearson.com/excel/ontime.htm for details how to use it. -- HTH Bob Phillips (remove xxx from email address if mailing direct) "Curt D." wrote in message ... how would I write a loop that would run until a certain time of day then execute the rest of the macro. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi. For a similar case, I used a code like this:
' If it's later than 23:45, Wait till next day TiempoPausa = 0 Inicio = 0 If Timer = 85500 Then While Timer = 85500 DoEvents Wend ' Wait until 00:05 While Timer <= 300 DoEvents Wend End If Inicio = Timer Your_routine ' Execute your code ' Wait 15 more minutes Minutos = 15 TiempoPausa = 60 * Minutos Do While Timer < Inicio + TiempoPausa DoEvents ' Other procceses Loop Yo can use While to loopback to your code, if neccesary. |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks Leonardo, which one would I use to have it automatically run at 11:30
pm? "Leonardo" wrote: Hi. For a similar case, I used a code like this: ' If it's later than 23:45, Wait till next day TiempoPausa = 0 Inicio = 0 If Timer = 85500 Then While Timer = 85500 DoEvents Wend ' Wait until 00:05 While Timer <= 300 DoEvents Wend End If Inicio = Timer Your_routine ' Execute your code ' Wait 15 more minutes Minutos = 15 TiempoPausa = 60 * Minutos Do While Timer < Inicio + TiempoPausa DoEvents ' Other procceses Loop Yo can use While to loopback to your code, if neccesary. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Run time error 1004 in loop | Excel Discussion (Misc queries) | |||
run time error 1004 in loop | Excel Discussion (Misc queries) | |||
use time functions inside if loop | Excel Worksheet Functions | |||
Loop time seems dependent on unrelated workbook - Why? | Excel Worksheet Functions | |||
loop to time in 24 hours format | Excel Programming |