{"id":88,"date":"2018-11-03T20:56:37","date_gmt":"2018-11-03T20:56:37","guid":{"rendered":"http:\/\/www.vbastring.com\/blog\/?p=88"},"modified":"2018-11-03T21:17:59","modified_gmt":"2018-11-03T21:17:59","slug":"vbastring-tip-2-excel-vba-msgbox-yes-no","status":"publish","type":"post","link":"https:\/\/vbastring.com\/blog\/2018\/11\/03\/vbastring-tip-2-excel-vba-msgbox-yes-no\/","title":{"rendered":"VBAString Tip 2:  Excel VBA Msgbox Yes No"},"content":{"rendered":"<p>This is how to add a msgbox with a yes and no prompt to your Excel worksheet.  <\/p>\n<p> Just add a button to your worksheet and then add the following code to its &#8220;Click&#8221; event:<\/p>\n<pre class=\"lang:vb decode:true \" >Sub Button1_Click()\r\n\r\n    Dim intAnswer As Integer\r\n    \r\n    intAnswer = MsgBox(\"Would you like to close the application.\", vbYesNo, \"Please Confirm\")\r\n    \r\n    Select Case intAnswer\r\n        Case vbYes\r\n             MsgBox \"The application will close now\", vbInformation, \"Notice\"\r\n             Application.Quit\r\n        Case vbNo\r\n            MsgBox \"Continue...\"\r\n            \r\n            Exit Sub\r\n            \r\n    End Select\r\n    \r\nEnd Sub\r\n<\/pre>\n<p><iframe loading=\"lazy\" width=\"560\" height=\"315\" src=\"https:\/\/www.youtube.com\/embed\/06Z53IRi5Zg\" frameborder=\"0\" allow=\"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen><\/iframe><\/p>\n<p>Let me know if you have any questions<\/p>\n<p>[simple_contact_form]\t<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is how to add a msgbox with a yes and no prompt to your Excel worksheet. Just add a button to your worksheet and then add the following code to its &#8220;Click&#8221; event: Sub Button1_Click() Dim intAnswer As Integer intAnswer = MsgBox(&#8220;Would you like to close the application.&#8221;, vbYesNo, &#8220;Please Confirm&#8221;) Select Case intAnswer [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"nf_dc_page":"","om_disable_all_campaigns":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[],"tags":[],"class_list":["post-88","post","type-post","status-publish","format-standard","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>VBAString Tip 2: Excel VBA Msgbox Yes No - My Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/vbastring.com\/blog\/2018\/11\/03\/vbastring-tip-2-excel-vba-msgbox-yes-no\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"VBAString Tip 2: Excel VBA Msgbox Yes No - My Blog\" \/>\n<meta property=\"og:description\" content=\"This is how to add a msgbox with a yes and no prompt to your Excel worksheet. Just add a button to your worksheet and then add the following code to its &#8220;Click&#8221; event: Sub Button1_Click() Dim intAnswer As Integer intAnswer = MsgBox(&quot;Would you like to close the application.&quot;, vbYesNo, &quot;Please Confirm&quot;) Select Case intAnswer [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/vbastring.com\/blog\/2018\/11\/03\/vbastring-tip-2-excel-vba-msgbox-yes-no\/\" \/>\n<meta property=\"og:site_name\" content=\"My Blog\" \/>\n<meta property=\"article:published_time\" content=\"2018-11-03T20:56:37+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2018-11-03T21:17:59+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/vbastring.com\\\/blog\\\/2018\\\/11\\\/03\\\/vbastring-tip-2-excel-vba-msgbox-yes-no\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/vbastring.com\\\/blog\\\/2018\\\/11\\\/03\\\/vbastring-tip-2-excel-vba-msgbox-yes-no\\\/\"},\"author\":{\"name\":\"admin\",\"@id\":\"https:\\\/\\\/vbastring.com\\\/blog\\\/#\\\/schema\\\/person\\\/e1de0b30e98940381697872449c341f5\"},\"headline\":\"VBAString Tip 2: Excel VBA Msgbox Yes No\",\"datePublished\":\"2018-11-03T20:56:37+00:00\",\"dateModified\":\"2018-11-03T21:17:59+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/vbastring.com\\\/blog\\\/2018\\\/11\\\/03\\\/vbastring-tip-2-excel-vba-msgbox-yes-no\\\/\"},\"wordCount\":52,\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/vbastring.com\\\/blog\\\/2018\\\/11\\\/03\\\/vbastring-tip-2-excel-vba-msgbox-yes-no\\\/\",\"url\":\"https:\\\/\\\/vbastring.com\\\/blog\\\/2018\\\/11\\\/03\\\/vbastring-tip-2-excel-vba-msgbox-yes-no\\\/\",\"name\":\"VBAString Tip 2: Excel VBA Msgbox Yes No - My Blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/vbastring.com\\\/blog\\\/#website\"},\"datePublished\":\"2018-11-03T20:56:37+00:00\",\"dateModified\":\"2018-11-03T21:17:59+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/vbastring.com\\\/blog\\\/#\\\/schema\\\/person\\\/e1de0b30e98940381697872449c341f5\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/vbastring.com\\\/blog\\\/2018\\\/11\\\/03\\\/vbastring-tip-2-excel-vba-msgbox-yes-no\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/vbastring.com\\\/blog\\\/2018\\\/11\\\/03\\\/vbastring-tip-2-excel-vba-msgbox-yes-no\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/vbastring.com\\\/blog\\\/2018\\\/11\\\/03\\\/vbastring-tip-2-excel-vba-msgbox-yes-no\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/vbastring.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"VBAString Tip 2: Excel VBA Msgbox Yes No\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/vbastring.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/vbastring.com\\\/blog\\\/\",\"name\":\"My Blog\",\"description\":\"My WordPress Blog\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/vbastring.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/vbastring.com\\\/blog\\\/#\\\/schema\\\/person\\\/e1de0b30e98940381697872449c341f5\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/b2feaa698a4bd91b409df1beb5ff6acc2d7842d4f78543d413ebd468bc0171af?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/b2feaa698a4bd91b409df1beb5ff6acc2d7842d4f78543d413ebd468bc0171af?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/b2feaa698a4bd91b409df1beb5ff6acc2d7842d4f78543d413ebd468bc0171af?s=96&d=mm&r=g\",\"caption\":\"admin\"},\"sameAs\":[\"https:\\\/\\\/vbastring.com\\\/blog\"],\"url\":\"https:\\\/\\\/vbastring.com\\\/blog\\\/author\\\/admin\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"VBAString Tip 2: Excel VBA Msgbox Yes No - My Blog","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:\/\/vbastring.com\/blog\/2018\/11\/03\/vbastring-tip-2-excel-vba-msgbox-yes-no\/","og_locale":"en_US","og_type":"article","og_title":"VBAString Tip 2: Excel VBA Msgbox Yes No - My Blog","og_description":"This is how to add a msgbox with a yes and no prompt to your Excel worksheet. Just add a button to your worksheet and then add the following code to its &#8220;Click&#8221; event: Sub Button1_Click() Dim intAnswer As Integer intAnswer = MsgBox(\"Would you like to close the application.\", vbYesNo, \"Please Confirm\") Select Case intAnswer [&hellip;]","og_url":"https:\/\/vbastring.com\/blog\/2018\/11\/03\/vbastring-tip-2-excel-vba-msgbox-yes-no\/","og_site_name":"My Blog","article_published_time":"2018-11-03T20:56:37+00:00","article_modified_time":"2018-11-03T21:17:59+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"Written by":"admin"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/vbastring.com\/blog\/2018\/11\/03\/vbastring-tip-2-excel-vba-msgbox-yes-no\/#article","isPartOf":{"@id":"https:\/\/vbastring.com\/blog\/2018\/11\/03\/vbastring-tip-2-excel-vba-msgbox-yes-no\/"},"author":{"name":"admin","@id":"https:\/\/vbastring.com\/blog\/#\/schema\/person\/e1de0b30e98940381697872449c341f5"},"headline":"VBAString Tip 2: Excel VBA Msgbox Yes No","datePublished":"2018-11-03T20:56:37+00:00","dateModified":"2018-11-03T21:17:59+00:00","mainEntityOfPage":{"@id":"https:\/\/vbastring.com\/blog\/2018\/11\/03\/vbastring-tip-2-excel-vba-msgbox-yes-no\/"},"wordCount":52,"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/vbastring.com\/blog\/2018\/11\/03\/vbastring-tip-2-excel-vba-msgbox-yes-no\/","url":"https:\/\/vbastring.com\/blog\/2018\/11\/03\/vbastring-tip-2-excel-vba-msgbox-yes-no\/","name":"VBAString Tip 2: Excel VBA Msgbox Yes No - My Blog","isPartOf":{"@id":"https:\/\/vbastring.com\/blog\/#website"},"datePublished":"2018-11-03T20:56:37+00:00","dateModified":"2018-11-03T21:17:59+00:00","author":{"@id":"https:\/\/vbastring.com\/blog\/#\/schema\/person\/e1de0b30e98940381697872449c341f5"},"breadcrumb":{"@id":"https:\/\/vbastring.com\/blog\/2018\/11\/03\/vbastring-tip-2-excel-vba-msgbox-yes-no\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/vbastring.com\/blog\/2018\/11\/03\/vbastring-tip-2-excel-vba-msgbox-yes-no\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/vbastring.com\/blog\/2018\/11\/03\/vbastring-tip-2-excel-vba-msgbox-yes-no\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/vbastring.com\/blog\/"},{"@type":"ListItem","position":2,"name":"VBAString Tip 2: Excel VBA Msgbox Yes No"}]},{"@type":"WebSite","@id":"https:\/\/vbastring.com\/blog\/#website","url":"https:\/\/vbastring.com\/blog\/","name":"My Blog","description":"My WordPress Blog","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/vbastring.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/vbastring.com\/blog\/#\/schema\/person\/e1de0b30e98940381697872449c341f5","name":"admin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/b2feaa698a4bd91b409df1beb5ff6acc2d7842d4f78543d413ebd468bc0171af?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/b2feaa698a4bd91b409df1beb5ff6acc2d7842d4f78543d413ebd468bc0171af?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/b2feaa698a4bd91b409df1beb5ff6acc2d7842d4f78543d413ebd468bc0171af?s=96&d=mm&r=g","caption":"admin"},"sameAs":["https:\/\/vbastring.com\/blog"],"url":"https:\/\/vbastring.com\/blog\/author\/admin\/"}]}},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/vbastring.com\/blog\/wp-json\/wp\/v2\/posts\/88","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/vbastring.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/vbastring.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/vbastring.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/vbastring.com\/blog\/wp-json\/wp\/v2\/comments?post=88"}],"version-history":[{"count":2,"href":"https:\/\/vbastring.com\/blog\/wp-json\/wp\/v2\/posts\/88\/revisions"}],"predecessor-version":[{"id":90,"href":"https:\/\/vbastring.com\/blog\/wp-json\/wp\/v2\/posts\/88\/revisions\/90"}],"wp:attachment":[{"href":"https:\/\/vbastring.com\/blog\/wp-json\/wp\/v2\/media?parent=88"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/vbastring.com\/blog\/wp-json\/wp\/v2\/categories?post=88"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/vbastring.com\/blog\/wp-json\/wp\/v2\/tags?post=88"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}