Hey all,
I have a timer set to repeat every 5mins after a certain time, but I just can't get it to stop after 4:35PM
Sub Workbook_Open()
Application.OnTime TimeValue("09:20:00"), "my_Procedure"
Application.OnTime TimeValue("09:30:04"), "my_Procedure"
Application.OnTime TimeValue("09:31:00"), "my_Procedure"
Application.OnTime TimeValue("09:33:00"), "my_Procedure"
Application.OnTime TimeValue("09:35:00"), "my_Procedure"
Application.OnTime TimeValue("09:38:00"), "my_Procedure"
Application.OnTime TimeValue("09:41:00"), "my_Procedure"
Application.OnTime TimeValue("09:45:00"), "my_Procedure"
Application.OnTime TimeValue("09:50:00"), "my_Procedure_repeated"
MsgBox "Morning Repeater Activated"
End Sub
Sub my_Procedure_repeated()
Dim nRow As Long
With ThisWorkbook.Sheets("Tracker")
nRow = .Range("D" & Rows.Count).End(xlUp).Row + 1
.Range("B" & nRow).Value = CDate(Format(Now, "hh:mm"))
.Range("D" & nRow).Value = .Range("D9").Value
.Range("F" & nRow).Value = .Range("F9").Value
.Range("H" & nRow).Value = .Range("H9").Value
.Range("J" & nRow).Value = .Range("J9").Value
.Range("L" & nRow).Value = .Range("L9").Value
.Range("N" & nRow).Value = .Range("N9").Value
.Range("P" & nRow).Value = .Range("P9").Value
.Range("Q" & nRow).Value = .Range("Q9").Value
End With
Call timer 'starting timer again
End Sub
Private Sub timer()
Application.OnTime Now + TimeValue("00:05:00"), "my_Procedure_repeated"
End Sub
Sub stoptimer()
Application.OnTime Now, Procedure:="timer", Schedule:=False
'Application.OnTime TimeValue("09:35:00"), "timer", Schedule:=False
End Sub
I've tried everything from previous ExcelForums posts, google searches and even previous MS Office Support inquiries but I just can't get it to stop unless I close all excel sheets; which I can't since I have too many important sheets to do so :/
Any help would be much appreciated!
Bookmarks