This is the way you have your Excel with macro can have timer and ticking
the code is
Dim ToStop As Variant
Sub ticking()
If ToStop <> "" Then GoTo ToExit
alertTime = Now + TimeValue("00:00:01")
Application.OnTime alertTime, "thisworkbook.ticking2"
Range("A1").Value = Now
ToExit:
End Sub
Sub ticking2()
If ToStop <> "" Then GoTo ToExit
alertTime = Now + TimeValue("00:00:01")
Application.OnTime alertTime, "thisworkbook.ticking"
Range("A1").Value = Now
ToExit:
End Sub
Sub StartTick()
ToStop = ""
ticking
End Sub
You can download the sample file
No comments:
Post a Comment