Types of Message Boxes (Simple ones)

Vishesh's picture

 Please see attached xl sheet to get an understanding of some simple message boxes. Feel free to let me know if you want something on other types of message boxes as well...will try and upload that...

Here is the code that's there in the sheet as well.

Option Explicit
 
 
 
Sub MsgInfo()
 
    MsgBox "This is a info msg", vbInformation, "Info Message"
 
End Sub
 
 
 
Sub MsgErr()
 
    MsgBox "This is an error msg", vbCritical, "Error Message"
 
End Sub
 
 
 
Sub MsgExclamation()
 
    MsgBox "This is an exclamation msg", vbExclamation, "Exclamation Message"
 
End Sub
 
 
 
Function MsgYesNo() As Long
 
    MsgYesNo = MsgBox("Press Yes/No/Cancel", vbYesNoCancel + vbDefaultButton1, "Yes/No/Cancel")
 
End Function
 
 
 
Sub MsgYesNoSub()
 
    Select Case MsgYesNo
 
    Case vbYes
 
        MsgBox "Yes selected"
 
    Case vbNo
 
        MsgBox "No selected"
 
    Case vbCancel
 
        MsgBox "Cancel selected"
 
    End Select
 
End Sub
 
 
 
Sub MsgQues()
 
    MsgBox "What do you want ?", vbQuestion + vbYesNo + vbDefaultButton1, "Ques Message"
 
End Sub
 
 
 

 

Message Boxes

AttachmentSize
MessageBoxes.xls27 KB