Wednesday, December 15, 2010

Input/Output Operations

6.1 InputBox Function

Displays a prompt in a dialog box, waits for the user to input text or click a button, and returns the contents of the text box.

Example:
Dim Input
Input = InputBox("Enter your name") 
MsgBox ("You entered: " & Input)
 

6.2 MsgBox Function

Displays a message in a dialog box, waits for the user to click a button, and returns a value indicating which button the user clicked.

Example:
Dim MyVar
MyVar = MsgBox ("Hello World!", 65, "MsgBox Example")

' MyVar contains either 1 or 2, depending on which button is clicked