Microsoft Office Tutorials and References
In Depth Information
FIGURE 23.2
An example of a dialog box displayed by the MsgBox function.
The InputBox Function
You use the InputBox function to return a string entered by the user. The syntax for this function
is (I have omitted some optional and rarely used arguments):
InputBox( prompt , title , default ,)
n prompt is the text displayed as the prompt in the dialog box.
n title is an optional argument that specifies the title displayed in the dialog box’s title
bar. If this argument is omitted, the application name is used as the title.
n default is an optional string expression that specifies the default response if the user
does not enter one. If this argument is omitted, the default response is an empty string.
This code uses the InputBox function to get the user’s country of residence, with “United States”
being the default response. The displayed dialog box is shown in Figure 23.3.
Dim Country As String
Country = InputBox(“Your country of residence?”, “Country”, _
“United States”)
Search JabSto ::




Custom Search