Answers for "run macro in excel every 5 minutes for a time period"

VBA
0

excel run macro every 5 minutes

Public RunWhen As Double
Public Const cRunWhat = "my_Procedure"

Sub StartTimer()
RunWhen = Now + TimeSerial(0, 10, 0)
Application.OnTime earliesttime:=RunWhen, procedure:=cRunWhat, _
     schedule:=True
End Sub

Sub StopTimer()
   On Error Resume Next
   Application.OnTime earliesttime:=RunWhen, _
       procedure:=cRunWhat, schedule:=False
End Sub

Sub my_Procedure()
    MsgBox "hello world"
    Call StartTimer
End Sub
Posted by: Guest on November-25-2020

Code answers related to "run macro in excel every 5 minutes for a time period"

Code answers related to "VBA"

Browse Popular Code Answers by Language