ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   validation date (https://www.excelbanter.com/excel-programming/311235-validation-date.html)

No Name

validation date
 
Anyone know where I can find code for validation of the
date. ie. user enters in mmddyyyy, I want to ensure that
the values they enter make sense (eg. month cannot be 33,
has to be between 1-12)

thx.

Kevin

validation date
 
Try the isDate function.

if(isdate(your date))then
....do your thing
endif

or

if(not isdate(your date))then
Msgbox "This is not a valid date"
exit sub
endif

etc...

Hope that helps!

Kevin
-----Original Message-----
Anyone know where I can find code for validation of the
date. ie. user enters in mmddyyyy, I want to ensure that
the values they enter make sense (eg. month cannot be 33,
has to be between 1-12)

thx.
.



All times are GMT +1. The time now is 10:55 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com