• Blog
  • Excel Downloads
    • Audit Tickmark Toolbar
  • Courses
    • Power BI
  • Contact
  • Checkout

Excel Zoom

...because it's more than just a calculator


Run Macro At a Specified Time

February 18, 2009 by Mark 2 Comments

Using the Application.OnTime Method will allow you to schedule a macro to be run at a specified time. The specified time can be either after certain amount of time has passed, or at a certain time of day. This is especially useful if you would like a daily or weekly report to be printed, without having to be around to print it. If the report is long, it might take a while to print, so it might be useful for the macro to run after business hours or on the weekend.

The only drawback to this macro is that the file must be open in order for it to run. You can have this automated for you by using the Windows Scheduler found in the Control Panel to open the file at a certain time, and have the code below run automatically when opened.

Copy all the code below. Paste it into your workbook’s Visual Basic editor, in a Module. Replace “my_macro” with whatever name you have given your macro.

Need help? Use our nifty guide to help figure out how to install and use your macros.

The code below will allow you to run a macro called “my_macro” 30 seconds from now. You can change the time to whatever time interval you would like.

You must be logged in and have an active membership to view this content. Please register or login to continue.

Use the following if you wish to run the macro at a certain time of day. The code below will automatically run my_macro at 5pm (written in 24 hour time as 17:00:00).

You must be logged in and have an active membership to view this content. Please register or login to continue.

Filed Under: Macros Tagged With: Automatic, Macros

Looking For More Help?

Contact us with any specific questions or feedback. We love to hear from you!

Recommend a new product and EARN! Contact us here for info

Need to level up your career? See our amazing Excel Courses here

Looking for the Excel Audit Tickmark Toolbar? Click Here, NOW ONLY $97!

Subscribe to our mailing list
  • Facebook
  • Twitter

Search this site…

Power BI Webinar
Power BI Course
Free Excel Dashboard Webinar

Copyright © 2025 · Magazine Pro Theme on Genesis Framework

Login Form

Lost your password?