Repeat several macros every 24h without having to restart the workbook.

luzikedy

New Member
Joined
May 23, 2014
Messages
45
Hi All,

Below is the code I use to trigger few macros in different time intervals. Currently I have to remember to close and open workbook at least once in 24 hours otherwise the macros will not perform very important tasks.

I was searching though forums and I was trying to implement things I found, but I couldn't get anything to work properly.

What should I add/change in order to have these macros repeated at given times everyday?

Private Sub Workbook_Open()


RaportShifts


Application.OnTime TimeValue("06:15:00"), "Send_Report_Email"
Application.OnTime TimeValue("10:00:00"), "Update_Links"
Application.OnTime TimeValue("14:15:00"), "Send_Report_Email"
Application.OnTime TimeValue("16:00:00"), "Update_Links"
Application.OnTime TimeValue("22:15:00"), "Send_Report_Email"

End Sub



Thx!
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
To keep the macros triggering indefinitely, you'll want to place the Application.OnTime triggers at the bottom of your other macros, as well. For example, keep your Workbook_Open sub the same, but in your Send_Report_Email macro, add the following line to the bottom:
Code:
Application.OnTime TimeValue("06:15:00"), "Send_Report_Email"
Follow the same process for each of your other macros.
 
Upvote 0
Thx for help. The whole concept works, but because I have the same macro executed 3 times a day I had to replicate the macro, so I have something link this now:

Application.OnTime TimeValue("06:15:00"), "Send_Report_Email1"
Application.OnTime TimeValue("10:00:00"), "Update_Links1"
Application.OnTime TimeValue("14:15:00"), "Send_Report_Email2"
Application.OnTime TimeValue("16:00:00"), "Update_Links2"
Application.OnTime TimeValue("22:15:00"), "Send_Report_Email3"
 
Upvote 0

Forum statistics

Threads
1,215,050
Messages
6,122,868
Members
449,097
Latest member
dbomb1414

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