The MsgBox method displays a message in a dialog box.
MsgBox(prompt, [buttons], [title])
Required. String displayed as the message in the dialog box.
Optional. Numeric expression that is the sum of values specifying the number and type of buttons to display, the icon style to use, and the identity of the default button. If omitted, the default value for buttons is 0.
| Constant | Description |
| 0 | Display OK button only. |
| 1 | Display OK and Cancel buttons. |
| 2 | Display Abort, Retry and Ignore buttons. |
| 3 | Display Yes, No and Cancel buttons. |
| 4 | Display Yes and No buttons. |
| 5 | Display Retry and Cancel buttons. |
| 6 | Display Cancel, Try Again and Continue buttons. |
| 7 | Display Continue and Abort buttons. |
| 16 | Displays the error message icon. |
| 32 | Displays the query message icon. |
| 48 | Displays the warning message icon. |
| 64 | Displays the information message icon. |
| 0 | The first button is the default. |
| 256 | The second button is the default. |
| 512 | The third button is the default. |
| 768 | The fourth button is the default. |
Optional. String displayed in the title bar of the dialog box.
| Value | Description |
| 1 | OK |
| 2 | Cancel |
| 3 | Abort |
| 4 | Retry |
| 5 | Ignore |
| 6 | Yes |
| 7 | No |
| 10 | Try Again |
| 11 | Continue |