How to display different types of message box in excel macro. Change the STYLE in the below code from the below given table and use message boxes as per your requirement like Information, Critical, Warning etc.
Sub NoDBSheetError(VariableSheetName)
Dim Msg2, Style2, Title2, Help2, Ctxt2, Response2
Msg2 = "  Sorry!!!  There is no sheet added for this month  " & VariableSheetName & ""
Style2 = vbOKOnly + vbCritical + vbDefaultButton2
Title2 = "Monthly Expences Calculator"    '-- Define title.
Help2 = "DEMO.HLP"    '-- Define Help file.
Ctxt2 = 1000    '-- Define topic

'-- Display message.

Response2 = MsgBox(Msg2, Style2, Title2, Help2, Ctxt2)
If Response2 = vbOK Then    '-- User chose Yes.
End
End If
End Sub
  Different kind of message box Style:–    
Member
Value
Description
OKOnly
0
Displays OK button only.
OKCancel
1
Displays OK and Cancel buttons.
AbortRetryIgnore
2
Displays Abort, Retry, and Ignore buttons.
YesNoCancel
3
Displays Yes, No, and Cancel buttons.
YesNo
4
Displays Yes and No buttons.
RetryCancel
5
Displays Retry and Cancel buttons.
Critical
16
Displays Critical Message icon.
Question
32
Displays Warning Query icon.
Exclamation
48
Displays Warning Message icon.
Information
64
Displays Information Message icon.
DefaultButton1
0
First button is default.
DefaultButton2
256
Second button is default.
DefaultButton3
512
Third button is default.
ApplicationModal
0
Application is modal. The user must respond to the message box before continuing work in the current application.
SystemModal
4096
System is modal. All applications are suspended until the user responds to the message box.
MsgBoxSetForeground
65536
Specifies the message box window as the foreground window.
MsgBoxRight
524288
Text is right-aligned.
MsgBoxRtlReading
1048576
Specifies text should appear as right-to-left reading on Hebrew and Arabic systems.