Excel Timer and Stopwatch

ppstja

New Member
Joined
Mar 27, 2012
Messages
1
I have a macro in an excel 2007 worksheet that does timed alerts and works great (one at 30minutes, one at 45 minutes and a third at 90 minutes. The macro is started by a checkbox. However I also need to simultaneously have have a visual timer also once the checkbox is checked. I have created a user form that does this but when I show the form the other timers stop until I cancel or stop the userform. I need them to run concurrently.

Public Sub Escalation_Timer()
Dim StartRed, PauseTimeRed, FinishRed, TotalTimeRed, StartYellow, PauseTimeYellow, FinishYellow, TotalTimeYellow, StartOrange, PauseTimeOrange, FinishOrange, TotalTimeOrange

If Range("E21") = True Then

If (MsgBox("Do you want to Start the Escalation Timer?", 4, "Escalate?")) = vbYes Then


PauseTimeOrange = 1800
StartOrange = Timer
PauseTimeYellow = 2700
StartYellow = Timer
PauseTimeRed = 5400
StartRed = Timer

Do While Timer < StartOrange + PauseTimeOrange
DoEvents
Loop
FinishOrange = Timer
TotalTime = FinishOrange - StartOrange
Application.Speech.Speak "Time to Escalate!"
Set objShell = CreateObject("Wscript.Shell")
objShell.Popup "Orange Escalation - Initiate Orange Escalation Procedure", _
120, "Orange Alert", vbInformation + 4096

'MsgBox "Orange Escalation - Initiate Orange Escalation Procedure", 0, "Orange Alert"
Else
End
End If

Do While Timer < StartYellow + PauseTimeYellow
DoEvents
Loop
FinishYellow = Timer
TotalTime = FinishYellow - StartYellow
Application.Speech.Speak "Time to Escalate!"
Set objShell = CreateObject("Wscript.Shell")
objShell.Popup "Yellow Escalation - Initiate Yellow Escalation Procedure", _
120, "Yellow Alert", vbInformation + 4096

'MsgBox "Yellow Escalation - Initiate Yellow Escalation Procedure", 0, "Yellow Alert"
Else
End
End If

Do While Timer < StartRed + PauseTimeRed
DoEvents
Loop
FinishRed = Timer
TotalTimeRed = FinishRed - StartRed
Application.Speech.Speak "Time to Escalate!"
Set objShell = CreateObject("Wscript.Shell")
objShell.Popup "Red Escalation - Initiate Red Escalation Procedure", _
120, "Red Alert", vbInformation + 4096
'MsgBox "Red Escalation - Initiate Red Escalation Procedure", 0, "Red Alert"

End
End Sub
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.

Forum statistics

Threads
1,215,633
Messages
6,125,922
Members
449,274
Latest member
mrcsbenson

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top