Hi,
I'm using the below code in VBA macro for date input box and it's working fine. What I want that if the date is incorrect than input box reappears again like Goto formula. Please can someone help me.
thanks
I'm using the below code in VBA macro for date input box and it's working fine. What I want that if the date is incorrect than input box reappears again like Goto formula. Please can someone help me.
thanks
VBA Code:
Public Sub UserDate()
Dim strDate As String
strDate = InputBox("Insert date in format dd/mm/yyyy", "User date", Format(Now(), "mm/dd/yyyy"))
If IsDate(strDate) Then
strDate = Format(CDate(strDate), "mm/dd/yyyy")
Range("C9") = strDate
Else
MsgBox "Wrong date format"
GoTo strDate
End If
End Sub