Public Sub DemoConfirm()
Dim Today As Date
Today = Now
TryAgain:
msg = "please enter date mm/dd/yy"
resp = Application.InputBox(msg, "Enter Date", Format(Today, "mm/dd/yy"))
If resp = False Then Exit Sub
If IsDate(resp) Then
If Format(resp, "mm/dd/yy") <> Format(Today, "mm/dd/yy") Then
msg = "Are you sure you want to use " & Format(resp, "mm/dd/yy") & " ?"
confirm = MsgBox(msg, vbQuestion + vbYesNoCancel, "Confirm Date")
Select Case confirm
Case vbyes:
Case vbNo: GoTo TryAgain
Case vbCancel: Exit Sub
End Select
End If
End If
MsgBox "date used " & Format(resp, "mm/dd/yy")
End Sub
Bookmarks