Prompt the user for input and store the result in a variable.
Syntax ResultVariable = InputBox (prompt [, title ] [, default ] [, xpos ] [, ypos ] [, helpfile ] [, context ] ) Key prompt The message to display. up to ~1024 characters. You can separate the lines using a carriage return character Chr(13), a linefeed character Chr(10), or both (Chr(13) & Chr(10)) between each line. title String to display in the title bar default The default response if no other input is provided. If you omit default, the text box is displayed empty. xpos Optional numeric expression that specifies, in twips, the horizontal distance of the left edge of the dialog box from the left edge of the screen. If omitted, the dialog box is horizontally centered. ypos Optional numeric expression that specifies, in twips, the vertical distance of the upper edge of the dialog box from the top of the screen. If omitted, the dialog box is vertically positioned approximately one-third of the way down the screen. helpfile Optional string expression that identifies the Help file. If helpfile is provided, context must also be provided. context Optional numeric expression that is the Help context number assigned to the appropriate Help topic by the Help author. If context is provided, helpfile must also be provided.
If you specify the helpfile and context arguments, a Help button will be automatically added to the dialog box.
MyResult = InputBox (Prompt:="Enter data", _
Context:="2001") MyResult2 = InputBox ("Enter the order date", "Demo input box")
“People who know little are usually great talkers, while men who know much say little” ~ Jean Jacques Rousseau
MsgBox - Display a message in a dialogue box.
© Copyright SS64.com 1999-2013
Some rights reserved