View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Harald Staff[_2_] Harald Staff[_2_] is offline
external usenet poster
 
Posts: 449
Default Date textboxe in userforms

Don't do this please. Don't prompt "Invalid date entry" on an annoying modal
msgbox just because the user entered a four digit year or forgot a leading
zero, your users will hate the application with good reasons.
There are several valid date formats and you should accept as many as
possible. Do

Dt = Datevalue(Me.Textbox1.Text)

and it accepts June 1, 12/31/08 and multiple others that makes sense in the
user's country. Your validation should be if the date is later than someday
reasonable or if Datevalue errs.

HTH. Best wishes Harald


"nir020" wrote in message
...
I am creating a userform in excel,

I need to create a user inputs into a which a valid date can only be
entered.

The required Date Format is "dd/mm/yy".

Can someone show me how to do this?