This will trap the specific error
but bear in mind that it can only detect a date error for dates entered after the 12th of each month...![]()
Private Sub CommandButton2_Click() Dim iMonth As Integer On Error GoTo Invalid iMonth = Day(Range("B3").Value) If iMonth > 12 Then MsgBox "Date Error" End If On Error GoTo 0 Exit Sub Invalid: MsgBox "Invalid date entry" On Error GoTo 0 End Sub
Bookmarks