ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Error Check Dates (https://www.excelbanter.com/excel-discussion-misc-queries/214455-error-check-dates.html)

jlclyde

Error Check Dates
 
I have a user form that I would like people to enter dates, I woudl
like to check to make sure that they are indeed dates. What is the
error checking for this? Could someone help with this?

Thanks,
Jay

Bob Umlas, Excel MVP

Error Check Dates
 
IF ISDATE(me.Textbox1.Text) then...

but you may want to further check years, because you MIGHT have a year of
3081, so maybe
IF Isdate(me.textbox1.Text) then
IF Year(me.textbox1.text)2100 then 'arbitrary year here
MsgBox "Invalid Date"
etc.

"jlclyde" wrote:

I have a user form that I would like people to enter dates, I woudl
like to check to make sure that they are indeed dates. What is the
error checking for this? Could someone help with this?

Thanks,
Jay



All times are GMT +1. The time now is 07:00 PM.

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