Create a Message Box : MsgBox

Using VBA you can create a message box like the following. The Message Box is a dialog box create in Excel VBA that you can you can use to inform the users.

message box

This message box was create by creating in your macro the following Visual Basic code

MsgBox "Hello this is a message box"

A critical message can be create with the following code. 

critical message

MsgBox "Hello this is a message box", vbCritical, "this is a title"


To enter a longer message like on 2 lines, enter the following code:

MsgBox "First Line" & vbNewLine & "Second Line"

2 line message box


Please Tweet, Like or Share us if you enjoyed.