If you want to pause clock - you cannot simply rely on Now() with displaying value (either include used pause time in displayed value or try for instance:
Sub runClock()
Range("B2").Value = tCtr
If clockOn = True Then
tCtr = tCtr + TimeValue("00:00:01")
Application.OnTime Now + TimeValue("00:00:01"), "runClock"
End If
End Sub
Sub startClock()
If chkStop = True Then
MsgBox "Stop clock first and then start"
Else
clockOn = True
chkStop = True
tCtr = 0
runClock
End If
End Sub
Sub stopClock()
clockOn = False
chkStop = False
Range("C3").Value = ""
Range("C4").Value = ""
End Sub
Sub resetClock()
If chkStop = True Then
MsgBox "Stop clock first and then reset"
Else
Range("B2").Value = 0
End If
End Sub
Sub pauseClock()
clockOn = False
End Sub
Sub resumeClock()
clockOn = True
Application.OnTime Now + TimeValue("00:00:01"), "runClock"
End Sub
as for countdown - add new variables with countdown timer value and state
red color if less than 5 seconds - use conditional formatting of the cell.
Bookmarks