Show a Custom Message

You can use VBA to display a simple message and an OK button on the screen. The syntax for doing so is

MsgBox "yourMessage"

where yourMessage is the prompt (the text to show), as shown in Figure 16-1.

Figure 16-1:

A simple custom message with an OK button.

yourMessage yourMessage

Figure 16-1:

A simple custom message with an OK button.

For example, the following VBA statement displays the exact message box shown in Figure 16-1:

MsgBox "Your message here."

The following statement shows the text Thank you. in a message box:

MsgBox "Thank you."

0 0

Post a comment