Private Sub YourSub()
Dim MyDate As String
MyDate = "11/15/896"
If IsDateEx(MyDate) Then
MsgBox "Valid"
Else
MsgBox "Not valid"
End If
End Sub
Private Function IsDateEx(strDate As String, Optional intSpan As Integer = 20) As Boolean
If IsDate(strDate) And Year(strDate) - intSpan <= Year(Now) And Year(strDate) + intSpan >= Year(Now) Then
IsDateEx = True
Else
IsDateEx = False
End If
End Function
will that work for times also ?