Vba input box in Excel
The InputBox is used to get dynamic input from the user.
The "Dynamic" refers to the fact that the user can assign value to a variable at the runtime.
This is most useful and simple to use.
Syntax
InputBox (,)
The Inputbox has other parameters such as Xposition,Yposition and so on but are not widely used.
The following example illustrates Input box functionality.
- Sub InpuBox()
- Dim i As Integer
- i = InputBox("Enter a number", "Input Box Demo")
- MsgBox I + 1
- End Sub
The screenshot of the script is shown below:
The Output is as shown below.
When a number is entered in the Inputbox and Ok clicked, a message box is isplayed with the output
You can find similar Excel Questions and Answer hereunder
1) How to change desktop background in Excel
2) How do I use Find to determine last occurrence of a string in a WorkSheet range using VBA?
3) I conducted a test and the test scores are available - how can I get Percentile rank of students?
4) How can I get input from user through a prompt and assign user's input to a cell?
5) How can I avoid a gap in a line chart for missing data?
6) How can I add a Prefix to a set of numbers in a range?
7) How to display messages boxes in VBA with the msgbox function
8) Here an explanation about list box and how to control list boxes in Excel VBA
9) I want a formula to concatenate multiple cell values separated by a line break.
10) How can I identify the cells that influence a particular cell to help with debugging of my spreadSheet or understand a spreadSheet that I inherited?