Displaying a simple message box

You can use the MsgBox function by itself or assign its result (that is, the button clicked by the user) to a variable. If you use this function by itself, don't include parentheses around the arguments. The following example simply displays a message and does not return a result:

Sub MsgBoxDemo()

MsgBox "Click OK to continue." End Sub

Figure 15-1 shows how this message box looks.

Figure 15-1:

A simple message box.

Figure 15-1:

A simple message box.

0 0

Post a comment