Macro runs every X minutes

mroseto

Board Regular
Joined
Jul 18, 2002
Messages
203
Hello all,

I know this is posted here, but I cant seem to get it to work. I have a macro that I want to run every 30 minutes or so. I may make it every hour, I haven't decided. After looking through all the posts on here I can't get it to work.

I know I have to use onTime but I have no idea how to make it work. Any help would be much appreciated.

Thanks

Mike
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
From Excel help

Example
This example runs my_Procedure 15 seconds from now.

Application.OnTime Now + TimeValue("00:00:15"), "my_Procedure"

This example runs my_Procedure at 5 P.M.

Application.OnTime TimeValue("17:00:00"), "my_Procedure"

This example cancels the OnTime setting from the previous example.

Application.OnTime EarliestTime:=TimeValue("17:00:00"), _
Procedure:="my_Procedure", Schedule:=False
 
Upvote 0
I can get that, but how do I reset it so it runs every 30 minutes? Do I add 1 line for 30 minutes, then anouther for 60 and so on?

Thanks for you quick response.
 
Upvote 0
Application.OnTime Now + TimeValue("00:30:00"), "my_Procedure"

will run the procedure every 30 minutes
 
Upvote 0
Ok, sorry for so many questions, but where does this go? In "This workbook" or in Module1?

Thanks again
 
Upvote 0

Forum statistics

Threads
1,214,377
Messages
6,119,182
Members
448,872
Latest member
lcaw

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top