Using the Application.InputBox method
The standard input box works well enough, until you try to capture data other than text. You're also limited to direct inputs, meaning that you cannot click on a value in the spreadsheet while the input box is active.
These are the two main limitations of the standard input box. The other one, the absence of built-in error handling, is also a drawback. There are, in other words, more than enough reasons to progress to the Application.InputBox
method.
In this recipe, we will be using the Application.InputBox
method to create input boxes with more functionality.
Getting ready
Make sure that DialogBoxes.xlsm
is still open. Insert a new sheet and enter the following data on Sheet2:
Now, switch to the VBA Editor and insert a new module.
How to do it…
Enter the following partial code to create an application input box:
- In Module3, start creating the following...