I'm trying to get a user entered date assigned to a date variable EndDate. I would like to do a couple of error checks:
1) If the date is not a date, e.g. someone enters text, then the user will be notified and sent back to the input box
2) If the date is before today, the user will be given an error message and sent back to the input box
Using the code below works fine for item 2 but if text is entered into the input box, an error occurs because EndDate type is Date
Dim EndDate As Date
EnterDate: EndDate = InputBox("Enter end date for ADU and POs in mm/dd/yyyy format")
If EndDate < Date Then
MsgBox "End date is earlier than or same as today. Enter valid end date."