To exit the inputbox form when a user press the cancel button, simply write exit sub when the result of the inputbox function is nothing:
Sub create_array()
pp = InputBox("How are you today?")
If pp = "" Then Exit Sub
msgbox("Your answer is " & pp)
If pp = "" Then Exit Sub
msgbox("Your answer is " & pp)
End Sub
Created by DoMyExcel.com © | Excel & VBA Consulting | Customized Excel Solutions starting at 89 USD
No comments:
Post a Comment