S
Sean
The code below, was taken from Chip Pearsons web site on On-Timers.
How could I tailor it so that the StartTimer only runs at 10:00am each
24 hours but only between two variable dates that are held in Sheet1
A1 & B1?
Thanks
Public RunWhen As Double
Public Const cRunIntervalSeconds = 1440 ' 24 Hours
Public Const cRunWhat = "The_Sub" ' the name of the procedure to run
Sub StartTimer()
RunWhen = Now + TimeSerial(0,0,cRunIntervalSeconds)
Application.OnTime EarliestTime:=RunWhen, Procedure:=cRunWhat,
Schedule:=True
End Sub
Sub The_Sub()
'''''''''''''''''
' Your Code Here
'''''''''''''''''
StartTimer
End Sub
How could I tailor it so that the StartTimer only runs at 10:00am each
24 hours but only between two variable dates that are held in Sheet1
A1 & B1?
Thanks
Public RunWhen As Double
Public Const cRunIntervalSeconds = 1440 ' 24 Hours
Public Const cRunWhat = "The_Sub" ' the name of the procedure to run
Sub StartTimer()
RunWhen = Now + TimeSerial(0,0,cRunIntervalSeconds)
Application.OnTime EarliestTime:=RunWhen, Procedure:=cRunWhat,
Schedule:=True
End Sub
Sub The_Sub()
'''''''''''''''''
' Your Code Here
'''''''''''''''''
StartTimer
End Sub