I am trying to have a Macro run at 10am, then run the macro every 15 minutes in order to update data...
I read thru some posts and some online guides and followed it step by step but this afternoon when I returned to my office the macro never ran(excel opened and selected)...
Here are all the SUB() i created. Can someone help me identify where I went wrong and what I need to adjust. Again, I want to start at 10am and run every 15 minutes until 5pm (i never included the end at 5pm but would like to)
' these Private Subs I placed in the "This Workbook" .....
Private Sub WorkBook_Open()
Application.OnTime TimeValue("10:00:00"), "Index_Analysis"
End Sub
----------------------------
Private Sub workbook_BeforeClose(Cancel As Boolean)
Application.OnTime dtime, "Index_Analysis", , False
End Sub
----------------------------
Private Sub WorkBook_Open()
Application.OnTime Now + TimeValue("00:15:00"), "Index_Analysis"
End Sub
----------------------------
' following the instructions i placed these commands under my macro, "Index_Analysis", then the code under these commands...
Sub Index_Analysis()
dtime = Now + Now + TimeValue("00:15:00")
Application.OnTime dtime, "Index_Analysis"
Application.OnTime
TimeValue ("10:00:00"), "Index_Analysis"
' my macro code to run Index_Analysis entered here
thanks if anyone can point out the error...
I read thru some posts and some online guides and followed it step by step but this afternoon when I returned to my office the macro never ran(excel opened and selected)...
Here are all the SUB() i created. Can someone help me identify where I went wrong and what I need to adjust. Again, I want to start at 10am and run every 15 minutes until 5pm (i never included the end at 5pm but would like to)
' these Private Subs I placed in the "This Workbook" .....
Private Sub WorkBook_Open()
Application.OnTime TimeValue("10:00:00"), "Index_Analysis"
End Sub
----------------------------
Private Sub workbook_BeforeClose(Cancel As Boolean)
Application.OnTime dtime, "Index_Analysis", , False
End Sub
----------------------------
Private Sub WorkBook_Open()
Application.OnTime Now + TimeValue("00:15:00"), "Index_Analysis"
End Sub
----------------------------
' following the instructions i placed these commands under my macro, "Index_Analysis", then the code under these commands...
Sub Index_Analysis()
dtime = Now + Now + TimeValue("00:15:00")
Application.OnTime dtime, "Index_Analysis"
Application.OnTime
TimeValue ("10:00:00"), "Index_Analysis"
' my macro code to run Index_Analysis entered here
thanks if anyone can point out the error...