This is overkill as the IsDate function will not allow an invalid number of days or months, so all you need is
In addition, your way only works for US dates, as we continentals use a dd/mm/yy format, where the first two digits can be greater than 12. Mine works for any.Private Sub CommandButton1_Click() If Not IsDate(TextBox1.Value) Then MsgBox ("This is not a date, Please try again") Else MsgBox ("This is a date, Good for you") End If End Sub
.




Reply With Quote