Date Change

  • Thread starter Thread starter Ben Allen
  • Start date Start date
B

Ben Allen

Hi,
When a user clicks a button on my worksheet a macro is run. This macro sets
a cell on a hidden sheet to be the current date. On Auto_open this date is
checked, if the current date is the cell value + 7 a message box is
displayed sayin "It is a week since you....". Is it possible to do instead
of + 7, + 1 month, as you cannot do +30 or +31 due to the varying days in a
month. Any suggestions?
Thanks
--
Cheers,
Ben

Remove your.tonsils to reply
"You only live once but if you do it right once is enough!"
 
One way:

Use DateDiff

If DateDiff("m", Sheets("hidden").Range("A1"), Date) > 1 Then _
MsgBox "More than a month"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Macro for Dates 5
Date find Macro 3
Excel Vba to change displayed year automatically. 14
Date Validation 2
Saving with date in filename 3
VBA code relative to current date 5
Save at start of month 1
Graph Macro 1

Back
Top