Hello,
I am running a macro that asks a user to input a date to parse some data from a file folder. The issue I'm having is keeping an error from popping up (Run-time error '13': Type mismatch) when the user selects "Cancel" or "X"s out of the inputbox. Here is the pertinent code.
Dim eDate As Date
eDate = InputBox("Enter the earliest date of the files you will be parsing." _
& vbNewLine & "Format: yyyy-mm-dd", "Enter Date", "yyyy-mm-dd")
If eDate = "False" Then
Exit Sub
End If
I have also tried the following codes to prevent the error.
If eDate = "" Then
Exit Sub
End If
If eDate = "0" Then -- with and without quotes
Exit Sub
End If
Bookmarks