don matteo
Board Regular
- Joined
- Nov 14, 2016
- Messages
- 51
Hey guys i have taken some code from online to create a countdown timer
and when it hits 00:00:00 a msg box pops up
but i want the box to pop up when the timer hits 00:05:00 (5 min remaining )
can anyone help?
thanks
and when it hits 00:00:00 a msg box pops up
but i want the box to pop up when the timer hits 00:05:00 (5 min remaining )
can anyone help?
thanks
Code:
Public gCount As Date
Sub Timer()
gCount = Now + TimeValue("00:00:01")
Application.OnTime gCount, "EndMessage"
End Sub
Sub EndMessage()
Dim xRng As Range
Set xRng = Application.ActiveSheet.Range("b10")
xRng.Value = xRng.Value - TimeSerial(0, 0, 1)
If xRng.Value <= 0 Then
MsgBox "SEND COMM ASAP"
Exit Sub
End If
Call Timer
End Sub
Sub StopClock()
Application.OnTime EarliestTime:=gCount, Procedure:="endmessage", Schedule:=False
End Sub