INPUTBOX

INPUTBOX(prompt [,title] [,default] [,xpos] [,ypos] [,helpfile, context])

Displays a dialog box allowing the user to enter some information (String).


promptThe message to be displayed (String).
title(Optional) The title to display at the top of the dialog box (String).
default(Optional) The default response if no other input is provided (String).
xpos(Optional) The horizontal distance of the left edge from the left edge of the screen (Integer).
ypos(Optional) The vertical distance of the top edge from the top edge of the screen (Integer).
helpfile(Optional) The help file to use to provide context-sensitive Help (String).
context(Optional) The context number assigned to the appropriate help topic (Integer).

REMARKS
* For more information, refer to the Msgbox & InputBox > InputBox page.
* This functions always returns a string.
* If "title" is left blank, then the application name is used.
* If "default" is left blank, then the textbox is displayed empty.
* If "xpos" is left blank, the dialog box is centred horizontally.
* If "ypos" is left blank, the dialog box is centred vertically.
* If "helpfile" is provided, then "context" must also be provided.
* If "context" is provided, then "helpfile" must also be provided.
* When both helpfile and context are provided, the user can press F1 to view the Help topic corresponding to the context.
* The "prompt" can contain a maximum of approximately 1024 characters depending on the width of the characters.
* The "prompt" can contan text on more than one line. You can separate the lines with a carriage return vbCrLf or Chr(13) & Chr(10).
* If the user presses OK or Enter, then whatever is in the text box will be returned.
* If the Cancel button is pressed, then a zero length string ("") is returned.
* To omit some positional arguments you must include the corresponding comma delimiters.
* You can use the MSGBOX function for displaying messages and asking simple questions.
* The equivalent .NET function is [[Microsoft.VisualBasic.Interaction.InputBox]]
* For the Microsoft documentation refer to learn.microsoft.com

InputBox "enter details" 
Call InputBox("enter details")

Dim sReturn As String
sReturn = InputBox("InputBox Text", "InputBox Title")
sReturn = InputBox("Please enter the website URL", "Website URL", "https://bettersolutions.com")

© 2024 Better Solutions Limited. All Rights Reserved. © 2024 Better Solutions Limited Top