MsgBox Instruction/Function

Syntax:
MsgBox Message$[, Type][, Title$]
-or-
MsgBox(Message$[, Type][, Title$])
Group: User Input
Description:
Show a message box titled Title$. Type controls what the message box looks like (choose one value from each category). Use MsgBox( ) if you need to know what button was pressed. The result indicates which button was pressed.
Result Value Button Pressed
Parameter Description

Message$ This string value is the text that is shown in the message box.
Type This number value controls the type of message box. Choose one value from each of the following tables.
Title$ This string value is the title of the message box.
Button Value Effect
  1. Abort, Retry, Ignore buttons
  1. Yes, No, Cancel buttons
Icon Value Effect

0 No icon Default Value Effect
  1. First button
  1. Second button
  1. Third button
Mode Value Effect
  1. Application modal
  1. System modal
Example:

Sub Main
MsgBox "Please press OK button"
If
MsgBox("Please press OK button",vbOkCancel) = vbOK Then
Debug
.Print "OK was pressed"
Else
Debug
.Print "Cancel was pressed"
End
If
End
Sub