Excel clock stops when I click a cell and begin typing.

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 Auto_Open()

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
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.

Forum statistics

Threads
1,215,489
Messages
6,125,093
Members
449,205
Latest member
ralemanygarcia

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top