palaeontology
Active Member
- Joined
- May 12, 2017
- Messages
- 444
- Office Version
- 2016
- Platform
- Windows
I am trying to get a live clock appearing in cell B2 of Sheet 1.
This is what I have as my Module 1, but it isn't working ... I need it to activate the moment the workbook is opened.
This is what I have as my Module 1, but it isn't working ... I need it to activate the moment the workbook is opened.
VBA Code:
Dim SchedRecalc As Date
Sub Recalc()
With Sheet1.Range("B2")
.Value = Format(Time, "hh:mm:ss AM/PM")
End With
Call SetTime
End Sub
Sub SetTime()
SchedRecalc = Now + TimeValue("00:00:01")
Application.OnTime SchedRecalc, "Recalc"
End Sub
Sub Disable()
On Error Resume Next
Application.OnTime EarliestTime:=SchedRecalc, Procedure:="Recalc", Schedule:=False
End Sub