Eg: Sub CommandButton1()
MsgBox "This is a sample box"
End Sub
Eg: Sub CommandButton1()
MsgBox "Should we stop?", vbYesNo
End Sub
Types of MsgBox:
MsgBox "Want to Continue?", vbOKCancel
MsgBox "Should we stop?", vbYesNo
MsgBox "What do you want to do?", vbAbortRetryIgnore
MsgBox "Should we stop?", vbYesNoCancel
MsgBox "What do you want to do next?", vbRetryCancel
MsgBox "What do you want to do next?", vbRetryCancel + vbMsgBoxHelpButton
MsgBox "What do you want to do next?", vbYesNoCancel + vbDefaultButton2
MsgBox "This is a sample box", vbCritical
MsgBox "This is a sample box", vbYesNo + vbInformation
MsgBox "This is a sample box", vbYesNo + vbCritical
MsgBox "This is a sample box", vbYesNo + vbQuestion
MsgBox "This is a sample box", vbYesNo + vbExclamation