View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
ND Pard ND Pard is offline
external usenet poster
 
Posts: 73
Default VBA check if date is in future

Private Sub txtBirthdate_Exit(ByVal Cancel As MSForms.ReturnBoolean)
If txtBirthdate = vbNullString Then Exit Sub
If Not IsDate(txtBirthdate) Then
MsgBox "That is not a valid birthdate."
Cancel = True
End If
If txtBirthdate Date(Now()) then
MsgBox "That date is in the future!"
Cancel = True
End If
End Sub