Is there a way to set a macro to automatically run at a certain time each day?
Is there a way to set a macro to automatically run at a certain time each day?
Look at the ONTIME method. lots of examples posted in the Forum
Hope that helps.
RoyUK
--------
For Excel Tips & Solutions, free examples and tutorials why not check out my web site
Free DataBaseForm example
Hi Martin,
Use this code:
If you run the above macro once, it will automatically run at the mentioned time again, i.e. 1530 hrs. But, Excel should be open at that time.![]()
Sub MacroName() Application.OnTime TimeValue("15:30:00"), "MacroName" 'Your code comes here MsgBox ("Hello") End Sub
--Karan--
Karan, you need a date in there as well:
![]()
Sub MacroName() ' Your declarations here ' Schedule to run again tomorrow: Application.OnTime Date + 1 + TimeValue("15:30"), "MacroName" ' Your code here End Sub
Entia non sunt multiplicanda sine necessitate
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks