Set a trap in a cell, ie when you run the macro it adds a date or something in a cell, then the next time it runs check the cell to see if there is a content or latest date and if then exist the sub, else run it.
Thanks for the reply. Can you be a little more specific though? I already have created a named range in excel that calculates the current time. Now I want a code that will look at this date and if it is the first time the model is open, then I would like it to run another macro.
What he means is you would choose a cell somewhere in the workbook, and when the sheet opens it would check the cell and if today's date were more recent than it, insert a new date and run the macro. If it were older or the same it would exit the sub.
Is that a bad thing though? Maybe he doesn't want the effects of the macro set in stone, or it may be a good thing that it runs again when the workbook is reopened. Depends on what he's trying to do.
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.