View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Mike H Mike H is offline
external usenet poster
 
Posts: 11,501
Default Text Box Dates in Userform?

Hi,

Private Sub TextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
If Not IsDate(TextBox1.Value) Then
MsgBox "Only dates allowed"
TextBox1.Value = ""
Cancel = True
End If
End Sub

Mike

"TotallyConfused" wrote:

How do I apply a date "mask" in an Userform textboxes. I have a lot of date
textboxes and want to make sure users do not enter anything else but date in
the textbox. Thank you in advance for any help you can provide.