View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Dennis Tucker Dennis Tucker is offline
external usenet poster
 
Posts: 140
Default Date dependent macro - run once only

What I would do is;

1. Setup a last run month cell. It contains the month number of the last
time the RunOnce macro ran.
2. At the beginning of the Workbook_Open macro, check the value in your last
run month cell.
If the value is different from this month's number, then trigger
your RunOnce macro.
3. At the end of your RunOnce macro, update your last run month cell.

"Wes_A" wrote in message
...
XP Pro / Excel 2007
I need to run a macro once only each month when the workbook is opened for
the first time in the new month. i.e. It should not run again in the same
month.
However, it should not skip a month in the (unlikely) event that the
workbook is not opened at all during that month and is only opened in the
month following......
Can anyone assist with code for this one?