View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Paul M.[_3_] Paul M.[_3_] is offline
external usenet poster
 
Posts: 2
Default Checking for valid date

Fantastic !!!...Thanks Ron and Tom, it works like a dream.
-----Original Message-----
Hi Paul

You can use the exit event like this.
It will not leave the textbox untill the textbox is a date

Private Sub TextBox1_Exit(ByVal Cancel As

MSForms.ReturnBoolean)
If Not IsDate(TextBox1.Text) Then
MsgBox "not a date"
Cancel = True
End If
End Sub



--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"Paul M." wrote in

message ...
I'm using a userform with a textbox among other things.

I
want to ensure that not only does the user submit a date
in that textbox, I want to make sure it is a valid date.
If the date is invalid, I want to display a warning
message.

Thanks for the help.

Paul



.