if inputbox cancel vba

The solution for “if inputbox cancel vba” can be found here. The following code will assist you in solving the problem.

Private Sub test()
Dim result As String
result = InputBox(“Enter Date MM/DD/YYY”, “Date Confirmation”, Now)
If StrPtr(result) = 0 Then
MsgBox (“User canceled!”)
ElseIf result = vbNullString Then
MsgBox (“User didn’t enter anything!”)
Else
MsgBox (“User entered ” & result)
End If
End Sub

Thank you for using DeclareCode; We hope you were able to resolve the issue.

More questions on [categories-list]

Similar Posts