So several of you helped me with the code below which is designed to track time on a spreadsheet. It is here:
Sub Recalc()With Sheet1.Range("U1")
.Value = Format(Time, "hhmm;@")
End With
Call SetTime
End Sub
----------------------------------------
Sub SetTime()
SchedRecalc = Now + TimeValue("00:00:10")
Application.OnTime SchedRecalc, "Recalc"
End Sub
The code below used to stop the timer, however it's not working and now every 10 seconds the macro runs, even if I close the spreadsheet. Please help fix the code so it will stop the timer:
Sub Disable()
On Error Resume Next
Application.OnTime EarliestTime:=SchedRecalc, Procedure:="Recalc", Schedule:=False
End Sub
Thank you in advance.
Sub Recalc()With Sheet1.Range("U1")
.Value = Format(Time, "hhmm;@")
End With
Call SetTime
End Sub
----------------------------------------
Sub SetTime()
SchedRecalc = Now + TimeValue("00:00:10")
Application.OnTime SchedRecalc, "Recalc"
End Sub
The code below used to stop the timer, however it's not working and now every 10 seconds the macro runs, even if I close the spreadsheet. Please help fix the code so it will stop the timer:
Sub Disable()
On Error Resume Next
Application.OnTime EarliestTime:=SchedRecalc, Procedure:="Recalc", Schedule:=False
End Sub
Thank you in advance.