{"id":12058,"date":"2011-10-11T10:19:10","date_gmt":"2011-10-11T10:19:10","guid":{"rendered":"http:\/\/www.learnexcelmacro.com\/?p=24"},"modified":"2017-10-08T03:24:14","modified_gmt":"2017-10-08T03:24:14","slug":"how-to-display-different-types-of-message-box-in-excel-macro","status":"publish","type":"post","link":"https:\/\/vmlogger.com\/excel\/2011\/10\/how-to-display-different-types-of-message-box-in-excel-macro\/","title":{"rendered":"Excel VBA Tutorial – Different types of message box in excel macro"},"content":{"rendered":"

[fusion_text]D<\/span>ear friends,
\nYou must have seen windows message boxes. As the names suggests, they are basically used as a popup to give some message to the user on screen.<\/p>\n

Based on type of message you are sending, you can format your message box accordingly. With Type of Message<\/strong>, I mean, is it a warning? Is it an Info? Is it critical? etc. Based on these type of message, icon in message box changes – which you must have noticed in many applications.<\/p>\n

Apart from these types which I have mentioned above, you might have noticed that, not all the message boxes has only OK button<\/strong>. There are message boxes, which has different buttons as well, like with Yes\/No button, Retry\/Cancel Button etc.<\/p>\n

All these different types of message boxes are inbuilt in Excel. You do not have to design them. All you need to know is – the parameters used in order to display them accordingly.<\/p>\n

Simple and most common message box in Excel using VBA<\/h1>\n

Usually while writing any macro or VBA code, you definately try to put a simple message box just to say.. Task completed<\/em><\/strong> at the end of your Macro. Something like below image<\/p>\n

\"Simple<\/a>

Simple Message Box – Excel Macro<\/p><\/div>\n

Let see the VBA code syntax for displaying message box in Excel<\/p>\n

MsgBox VBA Function Syntax<\/h2>\n

MsgBox [Prompt], [ButtonsType], [Title], [Help File Path], [Context]<\/code><\/p>\n

Where:<\/h2>\n

Prompt :<\/h2>\n

This is the ONLY argument which is mandatory in this MsgBox Function. As the name suggests this is the Text which you want to display as message in the Message Box.<\/p>\n

ButtonsType<\/h2>\n

This is an optional argument. VBA has predefined list of buttons for message box. For example, Yes\/No button, Retry\/Cancel button etc. I have provided the list of button types below in a table. This is a numeric expression.
\n“OKOnly”<\/strong> is the default value (when you do not specify anything).
\nNote: VBA, deos not allow you to Change the caption, color size etc of these buttons. They are all predefined.<\/p>\n

Title<\/h2>\n

(Optional) Title of the message box, which you want to provide. Default Title for the message box is “Microsoft Excel”<\/strong><\/p>\n

Help File Path<\/h2>\n

(Optional) This is for prividing URL for the Help file, in case you want to have a Help button on the message box and once, user clicks on it, then you are taken to the help file.<\/p>\n

Context<\/h2>\n

(Optional) This is related to the Help file you provide above. This is numeric number which is assigned to a particular section of the Help file.
\nNote:<\/strong> If this is provided, then Help file MUST be provided.<\/p>\n

Example: VBA code to Display Message Box in Excel<\/h1>\n

Lets start with a simple message box – just by providing the mandatory argument value i.e. Prompt.<\/p>\n

\r\nFunction displaySimpleMessageBox()\r\n    MsgBox \"Task Completed\"\r\nEnd Function\r\n<\/code><\/pre>\n

Result:<\/h2>\n

After running the above code, here is what you see:<\/p>\n

\"Simple<\/a>

Simple Message Box – Excel Macro<\/p><\/div>\n

Message Box with Help Button<\/h1>\n

Now let’s have a look at the message box with all the parameters filled in.<\/p>\n

\r\nSub sampleMessageBox()\r\n    Dim promptMessage\r\n    Dim btnStyle\r\n    Dim titleOfTheMessageBox\r\n    Dim helpFile\r\n    Dim contextNumber\r\n    \r\n    promptMessage = \"This the prompt message\"\r\n    btnStyle = vbCritical + vbMsgBoxHelpButton + vbRetryCancel\r\n    titleOfTheMessageBox = \"This is the title of the message Box\"\r\n    helpFile = \"\\\\helpfile.chm\"\r\n    contextNumber = 1000 'Section number in the help file\r\n    \r\n    MsgBox Prompt:=promptMessage, _\r\n    Buttons:=btnStyle, _\r\n    Title:=titleOfTheMessageBox, _\r\n    helpFile:=helpFile, _\r\n    Context:=contextNumber\r\nEnd Sub\r\n<\/code><\/pre>\n
\n

Note:<\/h2>\n

In the example, above as you can see I have combined 3 different Button style to one Message Box. Yes, you can combine more than one style on a message box but there is a rule. You can not randomly add as many as you want. I have explained this rule later in this article.<\/p>\n<\/div>\n

After running the above VBA code, following message box will be displayed.<\/p>\n

\"Message<\/a>

Message Box<\/p><\/div>\n

Button Styles for Message Box<\/h1>\n

All these parameters are grouped under following 4 categories.<\/p>\n

    \n
  • Group 1: <\/strong>Types of Buttons displayed on Message Box<\/li>\n
  • Group 2: <\/strong>Icon styles displayed on the message box<\/li>\n
  • Group 3: <\/strong>Which button to set as default<\/li>\n
  • Group 4: <\/strong>Overall design or modal of the message box<\/li>\n<\/ul>\n

    [\/fusion_text][title size=”1″ content_align=”left” style_type=”none” sep_color=”” margin_top=”10px” margin_bottom=”” class=”” id=””]Group 1: Types of Buttons displayed on Message Box[\/title][fusion_text]<\/p>\n

    \n\n\n\n\n\n\n\n\n\n\n
    Button Style Name<\/th>\nButton Style Numeric Value<\/th>\nDescription<\/th>\n<\/tr>\n<\/thead>\n
    vbCritical<\/td>\n16<\/td>\nCritical Icon displays besides the message prompt<\/td>\n<\/tr>\n
    vbQuestion<\/td>\n32<\/td>\nDisplays a Question icon\u00a0besides the message prompt<\/td>\n<\/tr>\n
    vbExclamation<\/td>\n48<\/td>\nDisplays exclamation icon besides the message prompt<\/td>\n<\/tr>\n
    vbInformation<\/td>\n64<\/td>\nDisplays Information icon besides the message prompt<\/td>\n<\/tr>\n
    vbYesNo<\/td>\n4<\/td>\nDisplays only Yes and No button<\/td>\n<\/tr>\n
    vbRetryCancel<\/td>\n5<\/td>\nDisplays two buttons – Retry and Cancel<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n

    [\/fusion_text][title size=”1″ content_align=”left” style_type=”none” sep_color=”” margin_top=”10px” margin_bottom=”” class=”” id=””]Group 2: Icon styles displayed on the message box[\/title][fusion_text]<\/p>\n

    \n\n\n\n\n\n\n\n\n
    Button Style Name<\/th>\nButton Style Numeric Value<\/th>\nDescription<\/th>\n<\/tr>\n<\/thead>\n
    vbOKOnly<\/td>\n0<\/td>\nDefault one. Displayed only OK button on the message Box<\/td>\n<\/tr>\n
    vbOKCancel<\/td>\n1<\/td>\nMessage Box with OK and Cancel \u00a0two buttons<\/td>\n<\/tr>\n
    vbAbortRetryIgnore<\/td>\n2<\/td>\nDisplays three buttons – Abort, Retry and Ignore<\/td>\n<\/tr>\n
    vbYesNoCancel<\/td>\n3<\/td>\nMessage Box with 3 buttons – Yes, No and Cancel<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n

    [\/fusion_text][title size=”1″ content_align=”left” style_type=”none” sep_color=”” margin_top=”10px” margin_bottom=”” class=”” id=””]Group 3: Which button to set as default[\/title][fusion_text]As you can see here, there are only 4 buttons which you can set as default. This is true because, at max in a message box, you can not add more than 4 buttons.<\/p>\n

    \n\n\n\n\n\n\n\n\n
    Button Style Name<\/th>\nButton Style Numeric Value<\/th>\nDescription<\/th>\n<\/tr>\n<\/thead>\n
    vbDefaultButton1<\/td>\n0<\/td>\nFirst<\/strong> Button is always default one<\/td>\n<\/tr>\n
    vbDefaultButton2<\/td>\n256<\/td>\nThis makes second<\/strong> button as default on the message box<\/td>\n<\/tr>\n
    vbDefaultButton3<\/td>\n512<\/td>\nThis makes third<\/strong> button as default on the message box<\/td>\n<\/tr>\n
    vbDefaultButton4<\/td>\n768<\/td>\nThis makes fourth<\/strong> button as default on the message box<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n

    [\/fusion_text][title size=”1″ content_align=”left” style_type=”none” sep_color=”” margin_top=”10px” margin_bottom=”” class=”” id=””]Group 4: Overall design or modal of the message box[\/title][fusion_text]<\/p>\n

    \n\n\n\n\n\n\n\n\n\n\n
    Button Style Name<\/th>\nButton Style Numeric Value<\/th>\nDescription<\/th>\n<\/tr>\n<\/thead>\n
    vbApplicationModel<\/td>\n0<\/td>\nDefault model<\/td>\n<\/tr>\n
    vbSystemModel<\/td>\n4096<\/td>\nSystem Model<\/td>\n<\/tr>\n
    vbMsgBoxHelpButton<\/td>\n16384<\/td>\nTo add a help button to your message box<\/td>\n<\/tr>\n
    vbMsgBoxSetForeground<\/td>\n65536<\/td>\nMessage box window is displayed as foreground window<\/td>\n<\/tr>\n
    vbMsgBoxRight<\/td>\n524288<\/td>\nMessage box prompt is right aligned<\/td>\n<\/tr>\n
    vbMsgBoxRtlReading<\/td>\n1048576<\/td>\nThis is for text to be displayed from Right to left. Arabic language<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n

    As you can see, All the parameters are categorized in 4 groups.[\/fusion_text][title size=”1″ content_align=”left” style_type=”none” sep_color=”” margin_top=”” margin_bottom=”” class=”” id=””]Rule to combine these parameters[\/title][fusion_text]It is a very simple rule. You can use only ONE parameters from each group at max. This means, in total, you can combine 4 parameters in a message box.<\/p>\n

    Buttons like Ok, Cancel, Yes, No etc. should have conditional statements to execute.
    \nFor example, if a message box has a Prompt like “do you want to continue?” with Yes and No button on it.
    \nWe should be able to capture the action which use has taken and based on that you start execution of that particular section.<\/p>\n

    Therefore, msgBox funciton returns some value on pressing the buttons. Even for cancel button, you should write code, if you want to cancel the program.<\/p>\n

    Let’s have a look the values what are returned by pressing different buttons from message box.[\/fusion_text][title size=”1″ content_align=”left” style_type=”default” sep_color=”” margin_top=”” margin_bottom=”” class=”” id=””]Values returned by MsgBox Function on Pressing each Button[\/title][fusion_text]Since MsgBox<\/strong> works like a VBA function<\/strong> as well, each button of message box, returns a specific value when user presses it.<\/p>\n

    Here is the list of values returned by MsgBox function on pressing buttons[\/fusion_text][fusion_text]<\/p>\n

    \n\n\n\n\n\n\n\n\n\n\n\n
    Button Name<\/th>\nReturned Constant<\/th>\nReturned Numeric Value<\/th>\n<\/tr>\n<\/thead>\n
    OK Button<\/td>\nvbOK<\/td>\n1<\/td>\n<\/tr>\n
    Cancel Button<\/td>\nvbCancel<\/td>\n2<\/td>\n<\/tr>\n
    Abort Button<\/td>\nvbAbort<\/td>\n3<\/td>\n<\/tr>\n
    Retry Button<\/td>\nvbRetry<\/td>\n4<\/td>\n<\/tr>\n
    Ignore Button<\/td>\nvbIgnore<\/td>\n5<\/td>\n<\/tr>\n
    Yes Button<\/td>\nvbYes<\/td>\n6<\/td>\n<\/tr>\n
    No Button<\/td>\nvbNo<\/td>\n7<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

     <\/p>\n<\/div>\n

    [\/fusion_text][fusion_text]By capturing the returned value from MsgBox<\/strong> function, you can always execute Excel Macro conditionally. Example: If Pressed yes.. then do this.. If No then do this.<\/p>\n

    Below are the examples where I have used MsgBox as a function to capture the response and do different tasks based on the buttons pressed.[\/fusion_text][title size=”1″ content_align=”left” style_type=”none” sep_color=”” margin_top=”” margin_bottom=”” class=”” id=””]Examples : Few most frequently used Message Box Types[\/title][fusion_text]Below examples will give you an idea, how you can capture the response from the message box and execute specific piece of codes.
    \nYou can use values from the above table and using these examples you can control the flow of execution of your macro, however you want.[\/fusion_text][title size=”1″ content_align=”left” style_type=”none” sep_color=”” margin_top=”20px” margin_bottom=”” class=”” id=””]Message box with Yes\/No and execute macro only if it is pressed Yes or No[\/title][fusion_text]<\/p>\n

    \r\nSub msgBoxWithYesNoWhenYesOrNoPressed()\r\n    Dim promptMessage\r\n    Dim btnStyle\r\n    Dim titleOfTheMessageBox\r\n    Dim resMsgBox\r\n    \r\n    promptMessage = \"Are you sure you want to clear data from Entire Sheet?\"\r\n    btnStyle = vbCritical + vbYesNo\r\n    titleOfTheMessageBox = \"Decistion Box - Clear Data\"\r\n        \r\n    resMsgBox = MsgBox(Prompt:=promptMessage, Buttons:=btnStyle, Title:=titleOfTheMessageBox)\r\n    If resMsgBox = vbYes Then ' or resMsgBox = 6 -- refer the above table\r\n        Debug.Print \"User has pressed Yes... write all the statement which you want to be executed when pressess Yes\"\r\n    Else\r\n        Debug.Print \"User has pressed Yes... write all the statement which you want to be executed when pressess No\"\r\n    End If\r\nEnd Sub\r\n\r\n<\/code><\/pre>\n

    In the above example, since, there are two buttons only, Yes and No<\/em><\/strong>, therefore, it make sense to assume that, If user has not pressed Yes, then it would have pressed No. That is why I have put the code in Else condition.<\/p>\n

    but if you have more than two buttons, then like vbYes (6)<\/strong>, you can also check the response with vbNo (7)<\/strong> and then execute the relevant macro.<\/p>\n

    \r\nSub msgBoxWithYesNoWhenNoPressed()\r\n    Dim promptMessage\r\n    Dim btnStyle\r\n    Dim titleOfTheMessageBox\r\n    Dim resMsgBox\r\n    \r\n    promptMessage = \"Are you sure you want to clear data from Entire Sheet?\"\r\n    btnStyle = vbCritical + vbYesNo\r\n    titleOfTheMessageBox = \"Decistion Box - Clear Data\"\r\n        \r\n    resMsgBox = MsgBox(Prompt:=promptMessage, Buttons:=btnStyle, Title:=titleOfTheMessageBox)\r\n    If resMsgBox = vbYes Then ' or resMsgBox = 6 -- refer the above table\r\n        Debug.Print \"User has pressed Yes... write all the statement which you want to be executed when pressess Yes\"\r\n        Exit Sub\r\n    End If\r\n    \r\n    If resMsgBox = vbNo Then ' or resMsgBox = 7 -- refer the above table\r\n        Debug.Print \"User has pressed Yes... write all the statement which you want to be executed when pressess No\"\r\n    End If\r\nEnd Sub\r\n<\/code><\/pre>\n

    [\/fusion_text][title size=”1″ content_align=”left” style_type=”none” sep_color=”” margin_top=”20px” margin_bottom=”” class=”” id=””]Execute specific macro when pressed Cancel button from Message Box[\/title][fusion_text]In the below example, you can see, I have created 3 if-else clause for Yes, No and Cancel button separately. <\/p>\n

    You can execute different macros on pressing different buttons.<\/p>\n

    \r\nSub msgBoxWithYesNoWhenCancelPressed()\r\n    Dim promptMessage\r\n    Dim btnStyle\r\n    Dim titleOfTheMessageBox\r\n    Dim resMsgBox\r\n    \r\n    promptMessage = \"Are you sure you want to clear data from Entire Sheet?\"\r\n    btnStyle = vbCritical + vbYesNoCancel\r\n    titleOfTheMessageBox = \"Decistion Box - Clear Data\"\r\n        \r\n    resMsgBox = MsgBox(Prompt:=promptMessage, Buttons:=btnStyle, Title:=titleOfTheMessageBox)\r\n    If resMsgBox = vbYes Then ' or resMsgBox = 6 -- refer the above table\r\n        Debug.Print \"User has pressed Yes... write all the statement which you want to be executed when pressess Yes\"\r\n        Exit Sub\r\n    End If\r\n    \r\n    If resMsgBox = vbNo Then ' or resMsgBox = 7 -- refer the above table\r\n        Debug.Print \"User has pressed Yes... write all the statement which you want to be executed when pressess No\"\r\n        Exit Sub\r\n    End If\r\n    \r\n    If resMsgBox = vbCancel Then ' or resMsgBox = 2 -- refer the above table\r\n        Exit Sub ' to exit from the program immediately\r\n    End If\r\nEnd Sub\r\n<\/code><\/pre>\n

    [\/fusion_text][fusion_text]<\/p>\n

    \n

    Conclusion:<\/h2>\n

    Now you know enough about message box in Excel VBA. You can display really awesome message boxes with your own Title, Prompt and different buttons.<\/p>\n

    If you have any question, doubt or suggestion, put them in the comment below. I would to respond as soon as possible.<\/p><\/div>\n

    [\/fusion_text]<\/p>\n<\/span>","protected":false},"excerpt":{"rendered":"

    [fusion_text]ear friends, You must have seen windows message boxes. As the names suggests, they are basically used as a popup to give some message to the user on screen. Based on type of message you are sending, you can format your message box accordingly. With Type of Message, I mean, is it a warning? Is […]<\/p>\n","protected":false},"author":45,"featured_media":14372,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_et_pb_use_builder":"","_et_pb_old_content":"","_et_gb_content_width":"","footnotes":""},"categories":[1246,1675],"tags":[],"class_list":["post-12058","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-macro","category-excel-macro-for-beginners"],"yoast_head":"\nExcel VBA Tutorial -All you need to know about Message Box in Excel VBA<\/title>\n<meta name=\"description\" content=\"All about message box in Excel VBA. Change the STYLE of message box - warning, critical, info etc. Change Title of Message Box. Help button in message box\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/vmlogger.com\/excel\/2011\/10\/how-to-display-different-types-of-message-box-in-excel-macro\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Excel VBA Tutorial - Different types of message box in excel macro\" \/>\n<meta property=\"og:description\" content=\"All about message box in Excel VBA. Change the STYLE of message box - warning, critical, info etc. Change Title of Message Box. Help button in message box\" \/>\n<meta property=\"og:url\" content=\"https:\/\/vmlogger.com\/excel\/2011\/10\/how-to-display-different-types-of-message-box-in-excel-macro\/\" \/>\n<meta property=\"og:site_name\" content=\"Let's excel in Excel\" \/>\n<meta property=\"article:publisher\" content=\"http:\/\/www.facebook.com\/vmlogger\" \/>\n<meta property=\"article:author\" content=\"http:\/\/www.facebook.com\/vmlogger\" \/>\n<meta property=\"article:published_time\" content=\"2011-10-11T10:19:10+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2017-10-08T03:24:14+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/vmlogger.com\/excel\/wp-content\/uploads\/sites\/11\/2017\/10\/All-About-Message-Boxes-in-Excel-VBA.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"800\" \/>\n\t<meta property=\"og:image:height\" content=\"538\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Vishwamitra Mishra\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/www.twitter.com\/learnexcelmacro\" \/>\n<meta name=\"twitter:site\" content=\"@learnexcelmacro\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Vishwamitra Mishra\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"10 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/vmlogger.com\/excel\/2011\/10\/how-to-display-different-types-of-message-box-in-excel-macro\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/vmlogger.com\/excel\/2011\/10\/how-to-display-different-types-of-message-box-in-excel-macro\/\"},\"author\":{\"name\":\"Vishwamitra Mishra\",\"@id\":\"https:\/\/vmlogger.com\/excel\/#\/schema\/person\/7500a107b0b2d35a8492acf0d11fc8e5\"},\"headline\":\"Excel VBA Tutorial – Different types of message box in excel macro\",\"datePublished\":\"2011-10-11T10:19:10+00:00\",\"dateModified\":\"2017-10-08T03:24:14+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/vmlogger.com\/excel\/2011\/10\/how-to-display-different-types-of-message-box-in-excel-macro\/\"},\"wordCount\":1617,\"commentCount\":2,\"publisher\":{\"@id\":\"https:\/\/vmlogger.com\/excel\/#\/schema\/person\/7500a107b0b2d35a8492acf0d11fc8e5\"},\"image\":{\"@id\":\"https:\/\/vmlogger.com\/excel\/2011\/10\/how-to-display-different-types-of-message-box-in-excel-macro\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/vmlogger.com\/excel\/wp-content\/uploads\/sites\/11\/2017\/10\/All-About-Message-Boxes-in-Excel-VBA.jpg\",\"articleSection\":[\"Excel Macro\",\"Excel Macro Tutorial\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/vmlogger.com\/excel\/2011\/10\/how-to-display-different-types-of-message-box-in-excel-macro\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/vmlogger.com\/excel\/2011\/10\/how-to-display-different-types-of-message-box-in-excel-macro\/\",\"url\":\"https:\/\/vmlogger.com\/excel\/2011\/10\/how-to-display-different-types-of-message-box-in-excel-macro\/\",\"name\":\"Excel VBA Tutorial -All you need to know about Message Box in Excel VBA\",\"isPartOf\":{\"@id\":\"https:\/\/vmlogger.com\/excel\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/vmlogger.com\/excel\/2011\/10\/how-to-display-different-types-of-message-box-in-excel-macro\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/vmlogger.com\/excel\/2011\/10\/how-to-display-different-types-of-message-box-in-excel-macro\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/vmlogger.com\/excel\/wp-content\/uploads\/sites\/11\/2017\/10\/All-About-Message-Boxes-in-Excel-VBA.jpg\",\"datePublished\":\"2011-10-11T10:19:10+00:00\",\"dateModified\":\"2017-10-08T03:24:14+00:00\",\"description\":\"All about message box in Excel VBA. Change the STYLE of message box - warning, critical, info etc. Change Title of Message Box. Help button in message box\",\"breadcrumb\":{\"@id\":\"https:\/\/vmlogger.com\/excel\/2011\/10\/how-to-display-different-types-of-message-box-in-excel-macro\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/vmlogger.com\/excel\/2011\/10\/how-to-display-different-types-of-message-box-in-excel-macro\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/vmlogger.com\/excel\/2011\/10\/how-to-display-different-types-of-message-box-in-excel-macro\/#primaryimage\",\"url\":\"https:\/\/vmlogger.com\/excel\/wp-content\/uploads\/sites\/11\/2017\/10\/All-About-Message-Boxes-in-Excel-VBA.jpg\",\"contentUrl\":\"https:\/\/vmlogger.com\/excel\/wp-content\/uploads\/sites\/11\/2017\/10\/All-About-Message-Boxes-in-Excel-VBA.jpg\",\"width\":800,\"height\":538,\"caption\":\"All-About-Message-Boxes-in-Excel-VBA\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/vmlogger.com\/excel\/2011\/10\/how-to-display-different-types-of-message-box-in-excel-macro\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/vmlogger.com\/excel\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Excel Macro\",\"item\":\"https:\/\/vmlogger.com\/excel\/macro\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Excel VBA Tutorial – Different types of message box in excel macro\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/vmlogger.com\/excel\/#website\",\"url\":\"https:\/\/vmlogger.com\/excel\/\",\"name\":\"Let's excel in Excel\",\"description\":\"Let's share knowledge\",\"publisher\":{\"@id\":\"https:\/\/vmlogger.com\/excel\/#\/schema\/person\/7500a107b0b2d35a8492acf0d11fc8e5\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/vmlogger.com\/excel\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/vmlogger.com\/excel\/#\/schema\/person\/7500a107b0b2d35a8492acf0d11fc8e5\",\"name\":\"Vishwamitra Mishra\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/vmlogger.com\/excel\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/vmlogger.com\/excel\/wp-content\/uploads\/sites\/11\/2022\/07\/avataaars-1.png\",\"contentUrl\":\"https:\/\/vmlogger.com\/excel\/wp-content\/uploads\/sites\/11\/2022\/07\/avataaars-1.png\",\"width\":528,\"height\":560,\"caption\":\"Vishwamitra Mishra\"},\"logo\":{\"@id\":\"https:\/\/vmlogger.com\/excel\/#\/schema\/person\/image\/\"},\"description\":\"My name is Vishwamitra Mishra. Friends Call me Vishwa. I hold a Bachelor\u2019s Degree in Computer Science from D.A.V.V. Indore & currently working as a Technical Lead having over 7 years of experience.\",\"sameAs\":[\"http:\/\/www.learnexcelmacro.com\",\"http:\/\/www.facebook.com\/vmlogger\",\"https:\/\/x.com\/https:\/\/www.twitter.com\/learnexcelmacro\",\"https:\/\/www.youtube.com\/c\/VMLogger\"],\"url\":\"https:\/\/vmlogger.com\/excel\/author\/vishwamitra\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Excel VBA Tutorial -All you need to know about Message Box in Excel VBA","description":"All about message box in Excel VBA. Change the STYLE of message box - warning, critical, info etc. Change Title of Message Box. Help button in message box","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/vmlogger.com\/excel\/2011\/10\/how-to-display-different-types-of-message-box-in-excel-macro\/","og_locale":"en_US","og_type":"article","og_title":"Excel VBA Tutorial - Different types of message box in excel macro","og_description":"All about message box in Excel VBA. Change the STYLE of message box - warning, critical, info etc. Change Title of Message Box. Help button in message box","og_url":"https:\/\/vmlogger.com\/excel\/2011\/10\/how-to-display-different-types-of-message-box-in-excel-macro\/","og_site_name":"Let's excel in Excel","article_publisher":"http:\/\/www.facebook.com\/vmlogger","article_author":"http:\/\/www.facebook.com\/vmlogger","article_published_time":"2011-10-11T10:19:10+00:00","article_modified_time":"2017-10-08T03:24:14+00:00","og_image":[{"width":800,"height":538,"url":"https:\/\/vmlogger.com\/excel\/wp-content\/uploads\/sites\/11\/2017\/10\/All-About-Message-Boxes-in-Excel-VBA.jpg","type":"image\/jpeg"}],"author":"Vishwamitra Mishra","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/www.twitter.com\/learnexcelmacro","twitter_site":"@learnexcelmacro","twitter_misc":{"Written by":"Vishwamitra Mishra","Est. reading time":"10 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/vmlogger.com\/excel\/2011\/10\/how-to-display-different-types-of-message-box-in-excel-macro\/#article","isPartOf":{"@id":"https:\/\/vmlogger.com\/excel\/2011\/10\/how-to-display-different-types-of-message-box-in-excel-macro\/"},"author":{"name":"Vishwamitra Mishra","@id":"https:\/\/vmlogger.com\/excel\/#\/schema\/person\/7500a107b0b2d35a8492acf0d11fc8e5"},"headline":"Excel VBA Tutorial – Different types of message box in excel macro","datePublished":"2011-10-11T10:19:10+00:00","dateModified":"2017-10-08T03:24:14+00:00","mainEntityOfPage":{"@id":"https:\/\/vmlogger.com\/excel\/2011\/10\/how-to-display-different-types-of-message-box-in-excel-macro\/"},"wordCount":1617,"commentCount":2,"publisher":{"@id":"https:\/\/vmlogger.com\/excel\/#\/schema\/person\/7500a107b0b2d35a8492acf0d11fc8e5"},"image":{"@id":"https:\/\/vmlogger.com\/excel\/2011\/10\/how-to-display-different-types-of-message-box-in-excel-macro\/#primaryimage"},"thumbnailUrl":"https:\/\/vmlogger.com\/excel\/wp-content\/uploads\/sites\/11\/2017\/10\/All-About-Message-Boxes-in-Excel-VBA.jpg","articleSection":["Excel Macro","Excel Macro Tutorial"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/vmlogger.com\/excel\/2011\/10\/how-to-display-different-types-of-message-box-in-excel-macro\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/vmlogger.com\/excel\/2011\/10\/how-to-display-different-types-of-message-box-in-excel-macro\/","url":"https:\/\/vmlogger.com\/excel\/2011\/10\/how-to-display-different-types-of-message-box-in-excel-macro\/","name":"Excel VBA Tutorial -All you need to know about Message Box in Excel VBA","isPartOf":{"@id":"https:\/\/vmlogger.com\/excel\/#website"},"primaryImageOfPage":{"@id":"https:\/\/vmlogger.com\/excel\/2011\/10\/how-to-display-different-types-of-message-box-in-excel-macro\/#primaryimage"},"image":{"@id":"https:\/\/vmlogger.com\/excel\/2011\/10\/how-to-display-different-types-of-message-box-in-excel-macro\/#primaryimage"},"thumbnailUrl":"https:\/\/vmlogger.com\/excel\/wp-content\/uploads\/sites\/11\/2017\/10\/All-About-Message-Boxes-in-Excel-VBA.jpg","datePublished":"2011-10-11T10:19:10+00:00","dateModified":"2017-10-08T03:24:14+00:00","description":"All about message box in Excel VBA. Change the STYLE of message box - warning, critical, info etc. Change Title of Message Box. Help button in message box","breadcrumb":{"@id":"https:\/\/vmlogger.com\/excel\/2011\/10\/how-to-display-different-types-of-message-box-in-excel-macro\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/vmlogger.com\/excel\/2011\/10\/how-to-display-different-types-of-message-box-in-excel-macro\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/vmlogger.com\/excel\/2011\/10\/how-to-display-different-types-of-message-box-in-excel-macro\/#primaryimage","url":"https:\/\/vmlogger.com\/excel\/wp-content\/uploads\/sites\/11\/2017\/10\/All-About-Message-Boxes-in-Excel-VBA.jpg","contentUrl":"https:\/\/vmlogger.com\/excel\/wp-content\/uploads\/sites\/11\/2017\/10\/All-About-Message-Boxes-in-Excel-VBA.jpg","width":800,"height":538,"caption":"All-About-Message-Boxes-in-Excel-VBA"},{"@type":"BreadcrumbList","@id":"https:\/\/vmlogger.com\/excel\/2011\/10\/how-to-display-different-types-of-message-box-in-excel-macro\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/vmlogger.com\/excel\/"},{"@type":"ListItem","position":2,"name":"Excel Macro","item":"https:\/\/vmlogger.com\/excel\/macro\/"},{"@type":"ListItem","position":3,"name":"Excel VBA Tutorial – Different types of message box in excel macro"}]},{"@type":"WebSite","@id":"https:\/\/vmlogger.com\/excel\/#website","url":"https:\/\/vmlogger.com\/excel\/","name":"Let's excel in Excel","description":"Let's share knowledge","publisher":{"@id":"https:\/\/vmlogger.com\/excel\/#\/schema\/person\/7500a107b0b2d35a8492acf0d11fc8e5"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/vmlogger.com\/excel\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/vmlogger.com\/excel\/#\/schema\/person\/7500a107b0b2d35a8492acf0d11fc8e5","name":"Vishwamitra Mishra","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/vmlogger.com\/excel\/#\/schema\/person\/image\/","url":"https:\/\/vmlogger.com\/excel\/wp-content\/uploads\/sites\/11\/2022\/07\/avataaars-1.png","contentUrl":"https:\/\/vmlogger.com\/excel\/wp-content\/uploads\/sites\/11\/2022\/07\/avataaars-1.png","width":528,"height":560,"caption":"Vishwamitra Mishra"},"logo":{"@id":"https:\/\/vmlogger.com\/excel\/#\/schema\/person\/image\/"},"description":"My name is Vishwamitra Mishra. Friends Call me Vishwa. I hold a Bachelor\u2019s Degree in Computer Science from D.A.V.V. Indore & currently working as a Technical Lead having over 7 years of experience.","sameAs":["http:\/\/www.learnexcelmacro.com","http:\/\/www.facebook.com\/vmlogger","https:\/\/x.com\/https:\/\/www.twitter.com\/learnexcelmacro","https:\/\/www.youtube.com\/c\/VMLogger"],"url":"https:\/\/vmlogger.com\/excel\/author\/vishwamitra\/"}]}},"_links":{"self":[{"href":"https:\/\/vmlogger.com\/excel\/wp-json\/wp\/v2\/posts\/12058"}],"collection":[{"href":"https:\/\/vmlogger.com\/excel\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/vmlogger.com\/excel\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/vmlogger.com\/excel\/wp-json\/wp\/v2\/users\/45"}],"replies":[{"embeddable":true,"href":"https:\/\/vmlogger.com\/excel\/wp-json\/wp\/v2\/comments?post=12058"}],"version-history":[{"count":0,"href":"https:\/\/vmlogger.com\/excel\/wp-json\/wp\/v2\/posts\/12058\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/vmlogger.com\/excel\/wp-json\/wp\/v2\/media\/14372"}],"wp:attachment":[{"href":"https:\/\/vmlogger.com\/excel\/wp-json\/wp\/v2\/media?parent=12058"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/vmlogger.com\/excel\/wp-json\/wp\/v2\/categories?post=12058"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/vmlogger.com\/excel\/wp-json\/wp\/v2\/tags?post=12058"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}