Yes
On Error resume next
>>you input routine
If Err then mydate = Listbox1.value
on Error goto 0
Ivan
Jim,
Instead of error handling per se, you might instead want to use message boxes with nested If structures, to inform the user what they need to do, and then inform them whether or not they did it correctly, all with code that checks what they type in as being a valid date or not. Here's one way to go about this:
Sub DateEntry()
Dim myDate As String
myDate = InputBox("Enter a date here:", "Date entry request")
If myDate <> "" Then
If IsDate(myDate) Then
MsgBox "Continue the macro", 64, "Valid date has been entered"
Else
MsgBox "You did not enter a valid date.", 48, "You goofed !!"
End If
End If
End Sub
Note, if the user hits OK or Cancel on the original input box, they simply get taken back to the worksheet. If they enter data in any form besides what Excel can recognize as a date, they get a message saying No Can Do.
Hope this helps.
Tom Urtis