Data Validation Question


Posted by Mav on December 24, 2001 7:43 AM

I would like to have the current date automatically inserted into a particualar cell when the workbook is open and to have a message box pop up if that date is between the 12th and 15th of the month.
I'm not very proficient with formulas, so I'm not sure how to write it out in the Data Validation settings.

Can someone please tell me the best way to achieve this?

Thanks in advance.

Mav

Posted by Paul Johnson on December 24, 2001 8:43 AM

Mav

to enter your date =Today()
a message box would require a vba macro... I have one if you are interested. It is on my home pc.

PJ

Posted by Shams on December 24, 2001 9:02 AM

Try the following :

Sub Auto_open()
Range("A1").Value = Date
If Day(Date) > 12 And Day(Date) < 15 Then
MsgBox "Date is between 12 and 15"
Else
MsgBox "Date is not between 12 and 15"
End If
End Sub


Regards,
Shams



Posted by Mav on December 26, 2001 10:50 AM

That did it!

Thanks!

Mav