Automatically run macro

Bobhelge

New Member
Joined
Jan 3, 2011
Messages
10
Hey,

Is there a way to automatically run a macro once a week (let's say friday at 12:00), but if the workbook is closed at that time run it the next time its opened?

I don't want it to run everytime on opening. Only if the friday schedule is missed.

Thank
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
Hi

You'll want to be searching for the Application.OnTime event, you should find something that will be able to help you out there; there's plenty of examples of it's uses on this Forum :)

As for the running of the macro if it misses the Friday I'd suggest using a cell as a holder for the date of the last time it was run, if it's longer than a 7 day time difference then launch your macro, if not just open the book as normal.

Hopefully that will point you in the right direction.
 
Upvote 0

Forum statistics

Threads
1,224,609
Messages
6,179,875
Members
452,949
Latest member
Dupuhini

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