View Single Post
  #1 (permalink)  
Old April 9th, 2013, 12:08 AM
psukanya psukanya is offline
Registered User
Points: 18, Level: 1
Points: 18, Level: 1 Points: 18, Level: 1 Points: 18, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2013
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default auto macro run in Excel

Hi,

I used this code to automate my macro
Private Sub Workbook_Open()

Application.OnTime TimeValue("08:58:00"), "RUN"
Application.OnTime TimeValue("09:00:00"), "RUN"
Application.OnTime TimeValue("10:00:00"), "RUN"
Application.OnTime TimeValue("11:50:00"), "RUN"
Application.OnTime TimeValue("12:00:00"), "RUN"
Application.OnTime TimeValue("13:00:00"), "RUN"
Application.OnTime TimeValue("13:10:00"), "RUN"
Application.OnTime TimeValue("14:00:00"), "RUN"
Application.OnTime TimeValue("15:00:00"), "RUN"
Application.OnTime TimeValue("15:33:00"), "RUN"
Application.OnTime TimeValue("16:00:00"), "RUN"
Application.OnTime TimeValue("16:30:00"), "RUN"
Application.OnTime TimeValue("17:00:00"), "RUN"
Application.OnTime TimeValue("17:30:00"), "RUN"
Application.OnTime TimeValue("18:00:00"), "RUN"
Application.OnTime TimeValue("19:00:00"), "RUN"
Application.OnTime TimeValue("20:00:00"), "RUN"

End Sub
Sub RunAMacro()

Application.RUN "path'!RUN"

End Sub

But the problem is...If my cursor is placed on other excel sheet at above mentioned time then macro executed in that sheet not in 'Path'
Could any one suggest the currect code.
*Path - File path
*Run - Macro name

I guess one loop is required to identify the file..Please suggest me and suggest me how to minimize the code to auto run the macro with 15min interval.

Thanks
Reply With Quote