mmn1000
Board Regular
- Joined
- Mar 17, 2020
- Messages
- 97
- Office Version
- 2019
- 2013
- Platform
- Windows
Hi,
Using the following code, a countdown is performed in sheet 1.
How do I change this code to display a message or exit Excel after the count is complete?
Using the following code, a countdown is performed in sheet 1.
VBA Code:
Sub Start_Timer()
'Check if the timer is finished and exit the macro if it is
If Range("H7").Value = 0 Then Exit Sub
'Add 1 second from the timer
Range("H7").Value = Range("H7").Value - TimeValue("00:00:01")
'Set when the macro should run again - should be the same time value
'as the previous line.
interval = Now + TimeValue("00:00:01")
'Make this macro run again in 1 second
Application.OnTime interval, "Start_Timer"
End Sub
How do I change this code to display a message or exit Excel after the count is complete?