{"id":91,"date":"2018-11-05T16:46:26","date_gmt":"2018-11-05T16:46:26","guid":{"rendered":"http:\/\/www.vbastring.com\/blog\/?p=91"},"modified":"2020-11-23T22:24:56","modified_gmt":"2020-11-23T22:24:56","slug":"how-to-make-an-input-box-in-excel-vba","status":"publish","type":"post","link":"https:\/\/vbastring.com\/blog\/2018\/11\/05\/how-to-make-an-input-box-in-excel-vba\/","title":{"rendered":"VBAString Tip 3: How To Make An Input Box In Excel VBA"},"content":{"rendered":"<p>This post will use VBA to show you how to display whatever a user enters in an input box. <\/p>\n<p>For example, if a user enters &#8220;123456789&#8221;, the output should be &#8220;account# 123456789 is available&#8221;.    <\/p>\n<p>First, add a button to your worksheet and input this VBA code behind it:<\/p>\n<pre class=\"lang:vb decode:true \" >Sub Button1_Click()\r\n    \r\n    Dim strInput As String\r\n    Dim strTextStart As String\r\n    Dim strTextEnd As String\r\n    \r\n    strTextStart = \"account# \"\r\n    strTextEnd = \" is available\"\r\n    \r\n    strInput = InputBox(\"Enter desired account number\", \"Account Number\", 0)\r\n    \r\n    MsgBox strTextStart &amp; strInput &amp; strTextEnd\r\n    \r\n\r\nEnd Sub\r\n\r\n<\/pre>\n<p>Watch this:<\/p>\n<p><iframe loading=\"lazy\" width=\"560\" height=\"315\" src=\"https:\/\/www.youtube.com\/embed\/TG--TKlgY24\" 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<p>****************************************************<\/p>\n<table border=\"1\" width=\"100%\">\n<tr>\n<td align=\"middle\">\n<div class=\"AW-Form-1094354588\"><\/div>\n<p><script type=\"text\/javascript\">(function(d, s, id) {\n    var js, fjs = d.getElementsByTagName(s)[0];\n    if (d.getElementById(id)) return;\n    js = d.createElement(s); js.id = id;\n    js.src = \"\/\/forms.aweber.com\/form\/88\/1094354588.js\";\n    fjs.parentNode.insertBefore(js, fjs);\n    }(document, \"script\", \"aweber-wjs-kkrwj13ov\"));\n<\/script>\n<\/td>\n<\/tr>\n<\/table>\n","protected":false},"excerpt":{"rendered":"<p>This post will use VBA to show you how to display whatever a user enters in an input box. For example, if a user enters &#8220;123456789&#8221;, the output should be &#8220;account# 123456789 is available&#8221;. First, add a button to your worksheet and input this VBA code behind it: Sub Button1_Click() Dim strInput As String Dim [&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-91","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 3: How To Make An Input Box In Excel VBA - 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\/05\/how-to-make-an-input-box-in-excel-vba\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"VBAString Tip 3: How To Make An Input Box In Excel VBA - My Blog\" \/>\n<meta property=\"og:description\" content=\"This post will use VBA to show you how to display whatever a user enters in an input box. For example, if a user enters &#8220;123456789&#8221;, the output should be &#8220;account# 123456789 is available&#8221;. First, add a button to your worksheet and input this VBA code behind it: Sub Button1_Click() Dim strInput As String Dim [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/vbastring.com\/blog\/2018\/11\/05\/how-to-make-an-input-box-in-excel-vba\/\" \/>\n<meta property=\"og:site_name\" content=\"My Blog\" \/>\n<meta property=\"article:published_time\" content=\"2018-11-05T16:46:26+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-11-23T22:24:56+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\\\/05\\\/how-to-make-an-input-box-in-excel-vba\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/vbastring.com\\\/blog\\\/2018\\\/11\\\/05\\\/how-to-make-an-input-box-in-excel-vba\\\/\"},\"author\":{\"name\":\"admin\",\"@id\":\"https:\\\/\\\/vbastring.com\\\/blog\\\/#\\\/schema\\\/person\\\/e1de0b30e98940381697872449c341f5\"},\"headline\":\"VBAString Tip 3: How To Make An Input Box In Excel VBA\",\"datePublished\":\"2018-11-05T16:46:26+00:00\",\"dateModified\":\"2020-11-23T22:24:56+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/vbastring.com\\\/blog\\\/2018\\\/11\\\/05\\\/how-to-make-an-input-box-in-excel-vba\\\/\"},\"wordCount\":70,\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/vbastring.com\\\/blog\\\/2018\\\/11\\\/05\\\/how-to-make-an-input-box-in-excel-vba\\\/\",\"url\":\"https:\\\/\\\/vbastring.com\\\/blog\\\/2018\\\/11\\\/05\\\/how-to-make-an-input-box-in-excel-vba\\\/\",\"name\":\"VBAString Tip 3: How To Make An Input Box In Excel VBA - My Blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/vbastring.com\\\/blog\\\/#website\"},\"datePublished\":\"2018-11-05T16:46:26+00:00\",\"dateModified\":\"2020-11-23T22:24:56+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/vbastring.com\\\/blog\\\/#\\\/schema\\\/person\\\/e1de0b30e98940381697872449c341f5\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/vbastring.com\\\/blog\\\/2018\\\/11\\\/05\\\/how-to-make-an-input-box-in-excel-vba\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/vbastring.com\\\/blog\\\/2018\\\/11\\\/05\\\/how-to-make-an-input-box-in-excel-vba\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/vbastring.com\\\/blog\\\/2018\\\/11\\\/05\\\/how-to-make-an-input-box-in-excel-vba\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/vbastring.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"VBAString Tip 3: How To Make An Input Box In Excel VBA\"}]},{\"@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 3: How To Make An Input Box In Excel VBA - 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\/05\/how-to-make-an-input-box-in-excel-vba\/","og_locale":"en_US","og_type":"article","og_title":"VBAString Tip 3: How To Make An Input Box In Excel VBA - My Blog","og_description":"This post will use VBA to show you how to display whatever a user enters in an input box. For example, if a user enters &#8220;123456789&#8221;, the output should be &#8220;account# 123456789 is available&#8221;. First, add a button to your worksheet and input this VBA code behind it: Sub Button1_Click() Dim strInput As String Dim [&hellip;]","og_url":"https:\/\/vbastring.com\/blog\/2018\/11\/05\/how-to-make-an-input-box-in-excel-vba\/","og_site_name":"My Blog","article_published_time":"2018-11-05T16:46:26+00:00","article_modified_time":"2020-11-23T22:24:56+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\/05\/how-to-make-an-input-box-in-excel-vba\/#article","isPartOf":{"@id":"https:\/\/vbastring.com\/blog\/2018\/11\/05\/how-to-make-an-input-box-in-excel-vba\/"},"author":{"name":"admin","@id":"https:\/\/vbastring.com\/blog\/#\/schema\/person\/e1de0b30e98940381697872449c341f5"},"headline":"VBAString Tip 3: How To Make An Input Box In Excel VBA","datePublished":"2018-11-05T16:46:26+00:00","dateModified":"2020-11-23T22:24:56+00:00","mainEntityOfPage":{"@id":"https:\/\/vbastring.com\/blog\/2018\/11\/05\/how-to-make-an-input-box-in-excel-vba\/"},"wordCount":70,"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/vbastring.com\/blog\/2018\/11\/05\/how-to-make-an-input-box-in-excel-vba\/","url":"https:\/\/vbastring.com\/blog\/2018\/11\/05\/how-to-make-an-input-box-in-excel-vba\/","name":"VBAString Tip 3: How To Make An Input Box In Excel VBA - My Blog","isPartOf":{"@id":"https:\/\/vbastring.com\/blog\/#website"},"datePublished":"2018-11-05T16:46:26+00:00","dateModified":"2020-11-23T22:24:56+00:00","author":{"@id":"https:\/\/vbastring.com\/blog\/#\/schema\/person\/e1de0b30e98940381697872449c341f5"},"breadcrumb":{"@id":"https:\/\/vbastring.com\/blog\/2018\/11\/05\/how-to-make-an-input-box-in-excel-vba\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/vbastring.com\/blog\/2018\/11\/05\/how-to-make-an-input-box-in-excel-vba\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/vbastring.com\/blog\/2018\/11\/05\/how-to-make-an-input-box-in-excel-vba\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/vbastring.com\/blog\/"},{"@type":"ListItem","position":2,"name":"VBAString Tip 3: How To Make An Input Box In Excel VBA"}]},{"@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\/91","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=91"}],"version-history":[{"count":5,"href":"https:\/\/vbastring.com\/blog\/wp-json\/wp\/v2\/posts\/91\/revisions"}],"predecessor-version":[{"id":516,"href":"https:\/\/vbastring.com\/blog\/wp-json\/wp\/v2\/posts\/91\/revisions\/516"}],"wp:attachment":[{"href":"https:\/\/vbastring.com\/blog\/wp-json\/wp\/v2\/media?parent=91"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/vbastring.com\/blog\/wp-json\/wp\/v2\/categories?post=91"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/vbastring.com\/blog\/wp-json\/wp\/v2\/tags?post=91"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}