{"id":4758,"date":"2017-01-19T08:53:36","date_gmt":"2017-01-19T08:53:36","guid":{"rendered":"http:\/\/www.isunshare.com\/blog\/?p=4758"},"modified":"2023-04-13T08:22:31","modified_gmt":"2023-04-13T08:22:31","slug":"add-or-delete-pop-up-message-box-to-cell","status":"publish","type":"post","link":"https:\/\/www.isunshare.com\/blog\/add-or-delete-pop-up-message-box-to-cell\/","title":{"rendered":"How to Add or Delete Pop-up Message Box to Excel Cell"},"content":{"rendered":"<p>If you want to add any description for any cell you select in Excel, pop-up message box is undoubtedly a good choice. With VBA code, you could easily <strong>create or delete pop-up message box to excel cell<\/strong>.<\/p>\n<h2>Add or Remove Pop-up Message Box to Excel Cell Using VBA Code<\/h2>\n<p><strong>Step 1:<\/strong> Open worksheet with cells that you need to display message box when you click it.<\/p>\n<p><strong>Step 2:<\/strong> Right click the sheet tab and select <strong>View Code<\/strong> from the context menu.<\/p>\n<p><a href=\"https:\/\/www.isunshare.com\/blog\/wp-content\/uploads\/2017\/01\/right-click-view-code-to-open-vba-window.png\" rel=\"attachment wp-att-4762\"><img loading=\"lazy\" decoding=\"async\" width=\"600\" height=\"307\" class=\"alignnone wp-image-4762 size-full\" src=\"https:\/\/www.isunshare.com\/blog\/wp-content\/uploads\/2017\/01\/right-click-view-code-to-open-vba-window.png\" alt=\"right click view code to open VBA window\" srcset=\"https:\/\/www.isunshare.com\/blog\/wp-content\/uploads\/2017\/01\/right-click-view-code-to-open-vba-window.png 600w, https:\/\/www.isunshare.com\/blog\/wp-content\/uploads\/2017\/01\/right-click-view-code-to-open-vba-window-300x154.png 300w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<p><strong>Step 3:<\/strong> Confirm sheet you choose in appearing <strong>Microsoft Visual Basic for Applications<\/strong> window.<\/p>\n<p><strong>Step 4:<\/strong> Copy and paste following VBA code in the right blank code window.<\/p>\n<p><span style=\"color: #808080;\"><em>Private Sub Worksheet_SelectionChange(ByVal Target\u00a0As Range)<br \/>\n<\/em><\/span><span style=\"color: #808080;\"><em>\u00a0\u00a0\u00a0\u00a0If Not Intersect(Target, Range(&#8220;A1:C10&#8221;))\u00a0Is Nothing Then _<br \/>\n<\/em><\/span><span style=\"color: #808080;\"><em>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0MsgBox\u00a0&#8220;Please input a number&#8221;, vbInformation,\u00a0&#8220;Kutools for Excel&#8221;<br \/>\n<\/em><\/span><span style=\"color: #808080;\"><em>End Sub<\/em><\/span><\/p>\n<p><a href=\"https:\/\/www.isunshare.com\/blog\/wp-content\/uploads\/2017\/01\/add-message-box-to-cell-using-vba-code.png\" rel=\"attachment wp-att-4763\"><img loading=\"lazy\" decoding=\"async\" width=\"600\" height=\"302\" class=\"alignnone wp-image-4763 size-full\" src=\"https:\/\/www.isunshare.com\/blog\/wp-content\/uploads\/2017\/01\/add-message-box-to-cell-using-vba-code.png\" alt=\"add message box to excel cell using VBA code\" srcset=\"https:\/\/www.isunshare.com\/blog\/wp-content\/uploads\/2017\/01\/add-message-box-to-cell-using-vba-code.png 600w, https:\/\/www.isunshare.com\/blog\/wp-content\/uploads\/2017\/01\/add-message-box-to-cell-using-vba-code-300x151.png 300w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<p><strong>Notes:<\/strong><\/p>\n<ol>\n<li>In the code, &#8220;<strong>A1:C10<\/strong>&#8221; means that message box will pop up when click on any cell of this range.<\/li>\n<li>\u00a0&#8220;<strong>Please input a number or name<\/strong>&#8221; is displayed content of the message box.<\/li>\n<\/ol>\n<p>If you want to change the content in pop-up message box, please enter that you want to display.<\/p>\n<p><strong>Step 3:<\/strong> Press <strong>Alt + Q<\/strong> to close the Microsoft Visual Basic for Applications window.<\/p>\n<p>From now on, when clicking on any cell of range <strong>A1:C10<\/strong>, you will get a message box as below screenshot shown.<\/p>\n<p><a href=\"https:\/\/www.isunshare.com\/blog\/wp-content\/uploads\/2017\/01\/successfully-pop-up-message-box-on-clicked-cell.png\" rel=\"attachment wp-att-4764\"><img loading=\"lazy\" decoding=\"async\" width=\"600\" height=\"308\" class=\"alignnone wp-image-4764 size-full\" src=\"https:\/\/www.isunshare.com\/blog\/wp-content\/uploads\/2017\/01\/successfully-pop-up-message-box-on-clicked-cell.png\" alt=\"successfully pop up message box on clicked cell\" srcset=\"https:\/\/www.isunshare.com\/blog\/wp-content\/uploads\/2017\/01\/successfully-pop-up-message-box-on-clicked-cell.png 600w, https:\/\/www.isunshare.com\/blog\/wp-content\/uploads\/2017\/01\/successfully-pop-up-message-box-on-clicked-cell-300x154.png 300w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<p>And if you want to remove the message box, just need to select the sheet tab to view its VBA code, and delete the code. Then there would be no pop-up message box to excel cell.<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Related Articles: <\/strong><\/p>\n<ul>\n<li><a href=\"https:\/\/www.isunshare.com\/blog\/add-show-hide-comments-to-cell\/\" target=\"_blank\" rel=\"noopener noreferrer\">How to Add\/Show\/Hide Comments to Cell in Excel 2010<\/a><\/li>\n<li><a href=\"https:\/\/www.isunshare.com\/blog\/remove-or-change-comment-author-name-in-excel\/\" target=\"_blank\" rel=\"noopener noreferrer\">How to Remove or Change Comment Author Name in Excel 2016\/2013\/2010<\/a><\/li>\n<li><a href=\"https:\/\/www.isunshare.com\/blog\/disable-excel-forgotten-password\/\" target=\"_blank\" rel=\"noopener noreferrer\">How to Disable Excel Forgotten Password to Open and Edit Excel File<\/a><\/li>\n<li><a href=\"https:\/\/www.isunshare.com\/excel-password\/remove-restrict-editing-in-excel-without-password.html\" target=\"_blank\" rel=\"noopener noreferrer\">How to Remove Restrict Editing in Excel 2007-2016 without Password<\/a><\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you want to add any description for any cell you select in Excel, pop-up message box is&#8230;<\/p>\n","protected":false},"author":1,"featured_media":126176,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[19],"tags":[230],"class_list":["post-4758","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-office-documents","tag-excel"],"_links":{"self":[{"href":"https:\/\/www.isunshare.com\/blog\/wp-json\/wp\/v2\/posts\/4758","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.isunshare.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.isunshare.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.isunshare.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.isunshare.com\/blog\/wp-json\/wp\/v2\/comments?post=4758"}],"version-history":[{"count":5,"href":"https:\/\/www.isunshare.com\/blog\/wp-json\/wp\/v2\/posts\/4758\/revisions"}],"predecessor-version":[{"id":7008,"href":"https:\/\/www.isunshare.com\/blog\/wp-json\/wp\/v2\/posts\/4758\/revisions\/7008"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.isunshare.com\/blog\/wp-json\/wp\/v2\/media\/126176"}],"wp:attachment":[{"href":"https:\/\/www.isunshare.com\/blog\/wp-json\/wp\/v2\/media?parent=4758"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.isunshare.com\/blog\/wp-json\/wp\/v2\/categories?post=4758"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.isunshare.com\/blog\/wp-json\/wp\/v2\/tags?post=4758"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}