VBA to run a max of once a day

shophoney

Active Member
Joined
Jun 16, 2014
Messages
286
Hi, I'm looking to have an excel file in my windows startup group and have it run when windows loads.

But I would like to have the code ONLY run once a day.

So if the code has already run today don't run it again till it's loaded tomorrow.

I can add a Power Pivot calculated column and have it list last refresh. Would that help?

Thanks
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
The code could create a named formula contain the last run date, and not run again until that date passes.
 
Upvote 0
I like to use a hidden 'Settings' tab with this kind of info. I save the current date to a row in this hidden tab the first time the Workbook is open that day, and read the value into a Global variable each time the Workbook opens, to see if I need to run the daily routine again.
 
Upvote 0

Forum statistics

Threads
1,224,822
Messages
6,181,165
Members
453,021
Latest member
Justyna P

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