I have a timer counter like this:
Dim SchedRecalc As Date
Sub Recalc()
With Sheet8.Range("A1")
.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
The timer increments by one second,but i like it to show milliseconds as well
The
TimeValue()
function can count only seconds. As I see, you are usingApplication.OnTime
function for waiting 1 sek. You can achieve this also withSleep()
, which you can get from kernel library. Try this (only works on Windows):