Quote from osorico:
This morn I was working in xlXP(sp3) and l looked up Application.Ontime. According to the last example in the docs, you can specify the previous time value (exactly as used to start the macro) to cancel it.
So instead of my previous extemporaneous suggestion, based on docs you could use a Static or a Public to stash the time last used to start the macro. Then use that stashed value to stop it. You will still need some conditional to determine whether or not to restart the macro or stop it. Something UNTESTED like...
Public vntLastStartTime As Variant
Sub StopTimer()
If JaneStopThisCrazyThing
Application.OnTime vntLastStartTime , "Macro2", False
vntLastStartTime = 0
Else
dTime = Now + TimeValue("00:05:00")
Application.OnTime dTime, "Macro2", False
vntLastStartTime = dtime
End if
End Sub
Using this concept, it might be useful to add an argument to the Sub that would be the conditional.
Good luck