Showing posts with label inputbox. Show all posts
Showing posts with label inputbox. Show all posts

Tuesday, March 15, 2016

How to manage the Cancel response from an inputbox in EXCEL VBA

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)
End Sub



Created by DoMyExcel.com © | Excel & VBA Consulting | Customized Excel Solutions starting at 89 USD
Services provided to Individuals and Businesses | Free Quote: DoMyExcel@gmail.com

Sunday, March 6, 2016

How to receive an text input from a message box in EXCEL VBA

If you want to ask the user for an input, you can create a userform or you can simply use the Inputbox() method of VBA. For example:

a = InputBox("Enter the name of the picture")






Created by DoMyExcel.com © | Excel & VBA Consulting | Customized Excel Solutions starting at 29 USD
Services provided to Individuals and Businesses | Free Quote: DoMyExcel@gmail.com