Automatically Run Macro everyday

mjones18

New Member
Joined
Jan 24, 2017
Messages
8
Hello,

I have a Macro called WeatherData which I would like to have run everyday automatically at 7:00am in the morning. If the workbook is left open, does anyone know how to easily automate this process?

Thank you.
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
paste this macro into the module with YOUR macro.
here I set the time in cell B2. (change if you need)
run : RunTimerApp
it will load and run your macro (here its: mMyMacro ) at the given time.

Code:
Public Sub RunTimerApp()
Dim vTim
vTim = Format(Range("b2").Value, "hh:nn:ss")
Application.OnTime TimeValue(vTim), "mMyMacro"
End Sub
 
Upvote 0
Thanks!

I put the code in the Module in the top line. Where is cell b2 and do I put a time in the cell? (i.e., 07:00:00) Below is the slightly updated code where I changed "mMyMacro" to "WeatherData" Is this correct?
Public Sub RunTimerApp()
Dim vTim
vTim = Format(Range("b2").Value, "hh:nn:ss")
Application.OnTime TimeValue(vTim), "WeatherData"
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,827
Messages
6,181,200
Members
453,022
Latest member
RobertV1609

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