Thread: count down
View Single Post
  #4   Report Post  
Tom Hewitt
 
Posts: n/a
Default

,

Heres what you need to do.

3 Macros As follows

1.

Sub Start()
'
' The_Sub Macro
' Macro recorded 06/04/2005 by Tom Hewitt
'


'
Calculate
'
RepeatTimer

End Sub

==========
The first Macro starts the calucation process.


Macro 2.

Sub RepeatTimer()
'
' Starttimer Macro
' Macro recorded 06/04/2005 by Tom Hewitt
'

RunWhen = Now + TimeSerial(0, 0, 1)
Application.OnTime earliesttime:=RunWhen, procedu="Start", _
schedule:=True
End Sub

=========
This repeats the process. On the first line alter the number 1 to the
number of seconds you require the calculation interval to be.

Macro 3.

Sub StopTimer()
'
' StopTimer Macro
' Macro recorded 06/04/2005 by Tom Hewitt


'
On Error Resume Next
Application.OnTime earliesttime:=RunWhen, _
procedu=cRunWhat, schedule:=False
End Sub

========
This stops the timer.

Enjoy. Adapted from the linked site mentioned in the thread above.

Cheers
Tom Hewitt



"P Sitaram" wrote:

See if you can adapt some of this code:

http://www.cpearson.com/excel/ontime.htm