pedie
Well-known Member
- Joined
- Apr 28, 2010
- Messages
- 3,875
The first code is to run the macro and the second code is to stop the 1st macro from running when i click on the button, but when i click on the button with 2nd macro on it, it does not stop the macro.
Please edit the second macro so that when i run the second macro it will stop the 1st macro from running. Thanks alot!
----------------------------
Sub Updateclok()<?xml:namespace prefix = o ns = "urn:schemas-microsoft-comfficeffice" /><o></o>
' My DIGITAL
ThisWorkbook.Sheets("blabla").Range("DigitalClock").Value = CDbl(Time)<o></o>
' Set up the next event one second from now<o></o>
NextTick = Now + TimeValue("00:10:02")<o></o>
Application.OnTime NextTick, "Updateclok"
End Sub
--------------------------
Sub Stopclk()
' Cancels the OnTime event (stops the clock)
On Error Resume Next
Application.OnTime NextTick, "UpdateClock", , False
End Sub
Please edit the second macro so that when i run the second macro it will stop the 1st macro from running. Thanks alot!
----------------------------
Sub Updateclok()<?xml:namespace prefix = o ns = "urn:schemas-microsoft-comfficeffice" /><o></o>
' My DIGITAL
ThisWorkbook.Sheets("blabla").Range("DigitalClock").Value = CDbl(Time)<o></o>
' Set up the next event one second from now<o></o>
NextTick = Now + TimeValue("00:10:02")<o></o>
Application.OnTime NextTick, "Updateclok"
End Sub
--------------------------
Sub Stopclk()
' Cancels the OnTime event (stops the clock)
On Error Resume Next
Application.OnTime NextTick, "UpdateClock", , False
End Sub