Cheecochongo
New Member
- Joined
- Dec 30, 2015
- Messages
- 3
Hi everyone. I am new to so I hope I am doing this correctly.
I have a clock on my excel sheet that works great but it stops when I start typing in a cell. The following is the code I am using. I need a way of rewriting or adding to the code so the clock stays running. Thanks everyone.
Dim RunClk As Boolean
Sub Autpen()
RunClk = Not (RunClk)
Do While RunClk = True
DoEvents
Range("A1") = TimeValue(Now)
Range("A2") = Now()
Loop
End Sub
Sub Recalc()
Do While RunClk = True
SchedRecalc = Now + TimeValue("00:00:01")
Application.OnTime SchedRecalc, "Recalc"
On Error Resume Next
Application.OnTime EarliestTime:=SchedRecalc, Procedure:="Recalc", Schedule:=False
Loop
End Sub
I have a clock on my excel sheet that works great but it stops when I start typing in a cell. The following is the code I am using. I need a way of rewriting or adding to the code so the clock stays running. Thanks everyone.
Dim RunClk As Boolean
Sub Autpen()
RunClk = Not (RunClk)
Do While RunClk = True
DoEvents
Range("A1") = TimeValue(Now)
Range("A2") = Now()
Loop
End Sub
Sub Recalc()
Do While RunClk = True
SchedRecalc = Now + TimeValue("00:00:01")
Application.OnTime SchedRecalc, "Recalc"
On Error Resume Next
Application.OnTime EarliestTime:=SchedRecalc, Procedure:="Recalc", Schedule:=False
Loop
End Sub