{"id":145,"date":"2018-11-16T18:08:14","date_gmt":"2018-11-16T18:08:14","guid":{"rendered":"http:\/\/www.vbastring.com\/blog\/?p=145"},"modified":"2018-11-16T18:21:19","modified_gmt":"2018-11-16T18:21:19","slug":"vbastring-tip-8-how-to-create-a-simple-userform","status":"publish","type":"post","link":"https:\/\/vbastring.com\/blog\/2018\/11\/16\/vbastring-tip-8-how-to-create-a-simple-userform\/","title":{"rendered":"VBAString Tip 8: How To Create A Simple UserForm"},"content":{"rendered":"<p>In this tip I am going to show you how to create a simple userform in Excel<\/p>\n<p>You are going to find out how to show the userform and transfer the data from your userform<br \/>\nto your worksheet.  <\/p>\n<p>If you want more advanced userform tips, click on the &#8220;UserForm&#8221; category on the right of the screen.<\/p>\n<p>1.  Right click in the VBE, and insert a UserForm.<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/www.vbastring.com\/blog\/wp-content\/uploads\/2018\/11\/add_userform.png\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.vbastring.com\/blog\/wp-content\/uploads\/2018\/11\/add_userform.png?resize=793%2C655\" alt=\"add_userform\" width=\"793\" height=\"655\" class=\"alignleft size-full wp-image-131\" \/><\/a><\/p>\n<p>Use the toolbox to add 2 controls for &#8220;First Name&#8221; and &#8220;Last Name&#8221;.  Add a 3rd control, a command button, to enter into the worksheet the values from the userform.<\/p>\n<p>Add a button to the worksheet, to show the userform. <\/p>\n<p>The macro code is:<\/p>\n<pre class=\"lang:vb decode:true \" >Sub Button1_Click()\r\n    UserForm1.Show\r\nEnd Sub\r\n<\/pre>\n<p><a href=\"https:\/\/i0.wp.com\/www.vbastring.com\/blog\/wp-content\/uploads\/2018\/11\/userform_add_btn_8.png\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.vbastring.com\/blog\/wp-content\/uploads\/2018\/11\/userform_add_btn_8.png?resize=569%2C373\" alt=\"\" width=\"569\" height=\"373\" class=\"alignleft size-full wp-image-151\" \/><\/a><\/p>\n<p>Add this code to the &#8220;Enter&#8221; button:<\/p>\n<pre class=\"lang:vb decode:true \" >Private Sub btnEnter_Click()\r\n    Range(\"A1\") = Me.txtFname\r\n    Range(\"B1\") = Me.txtLname\r\n    \r\nEnd Sub\r\n<\/pre>\n<p>That&#8217;s all.  Now watch how it&#8217;s done:<\/p>\n<p><iframe loading=\"lazy\" width=\"560\" height=\"315\" src=\"https:\/\/www.youtube.com\/embed\/0R0rKIrHyAA\" 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>In this tip I am going to show you how to create a simple userform in Excel You are going to find out how to show the userform and transfer the data from your userform to your worksheet. If you want more advanced userform tips, click on the &#8220;UserForm&#8221; category on the right of the [&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-145","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 8: How To Create A Simple UserForm - 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\/16\/vbastring-tip-8-how-to-create-a-simple-userform\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"VBAString Tip 8: How To Create A Simple UserForm - My Blog\" \/>\n<meta property=\"og:description\" content=\"In this tip I am going to show you how to create a simple userform in Excel You are going to find out how to show the userform and transfer the data from your userform to your worksheet. If you want more advanced userform tips, click on the &#8220;UserForm&#8221; category on the right of the [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/vbastring.com\/blog\/2018\/11\/16\/vbastring-tip-8-how-to-create-a-simple-userform\/\" \/>\n<meta property=\"og:site_name\" content=\"My Blog\" \/>\n<meta property=\"article:published_time\" content=\"2018-11-16T18:08:14+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2018-11-16T18:21:19+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/www.vbastring.com\/blog\/wp-content\/uploads\/2018\/11\/add_userform.png\" \/>\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\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/vbastring.com\\\/blog\\\/2018\\\/11\\\/16\\\/vbastring-tip-8-how-to-create-a-simple-userform\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/vbastring.com\\\/blog\\\/2018\\\/11\\\/16\\\/vbastring-tip-8-how-to-create-a-simple-userform\\\/\"},\"author\":{\"name\":\"admin\",\"@id\":\"https:\\\/\\\/vbastring.com\\\/blog\\\/#\\\/schema\\\/person\\\/e1de0b30e98940381697872449c341f5\"},\"headline\":\"VBAString Tip 8: How To Create A Simple UserForm\",\"datePublished\":\"2018-11-16T18:08:14+00:00\",\"dateModified\":\"2018-11-16T18:21:19+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/vbastring.com\\\/blog\\\/2018\\\/11\\\/16\\\/vbastring-tip-8-how-to-create-a-simple-userform\\\/\"},\"wordCount\":143,\"image\":{\"@id\":\"https:\\\/\\\/vbastring.com\\\/blog\\\/2018\\\/11\\\/16\\\/vbastring-tip-8-how-to-create-a-simple-userform\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/www.vbastring.com\\\/blog\\\/wp-content\\\/uploads\\\/2018\\\/11\\\/add_userform.png\",\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/vbastring.com\\\/blog\\\/2018\\\/11\\\/16\\\/vbastring-tip-8-how-to-create-a-simple-userform\\\/\",\"url\":\"https:\\\/\\\/vbastring.com\\\/blog\\\/2018\\\/11\\\/16\\\/vbastring-tip-8-how-to-create-a-simple-userform\\\/\",\"name\":\"VBAString Tip 8: How To Create A Simple UserForm - My Blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/vbastring.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/vbastring.com\\\/blog\\\/2018\\\/11\\\/16\\\/vbastring-tip-8-how-to-create-a-simple-userform\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/vbastring.com\\\/blog\\\/2018\\\/11\\\/16\\\/vbastring-tip-8-how-to-create-a-simple-userform\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/www.vbastring.com\\\/blog\\\/wp-content\\\/uploads\\\/2018\\\/11\\\/add_userform.png\",\"datePublished\":\"2018-11-16T18:08:14+00:00\",\"dateModified\":\"2018-11-16T18:21:19+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/vbastring.com\\\/blog\\\/#\\\/schema\\\/person\\\/e1de0b30e98940381697872449c341f5\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/vbastring.com\\\/blog\\\/2018\\\/11\\\/16\\\/vbastring-tip-8-how-to-create-a-simple-userform\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/vbastring.com\\\/blog\\\/2018\\\/11\\\/16\\\/vbastring-tip-8-how-to-create-a-simple-userform\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/vbastring.com\\\/blog\\\/2018\\\/11\\\/16\\\/vbastring-tip-8-how-to-create-a-simple-userform\\\/#primaryimage\",\"url\":\"http:\\\/\\\/www.vbastring.com\\\/blog\\\/wp-content\\\/uploads\\\/2018\\\/11\\\/add_userform.png\",\"contentUrl\":\"http:\\\/\\\/www.vbastring.com\\\/blog\\\/wp-content\\\/uploads\\\/2018\\\/11\\\/add_userform.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/vbastring.com\\\/blog\\\/2018\\\/11\\\/16\\\/vbastring-tip-8-how-to-create-a-simple-userform\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/vbastring.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"VBAString Tip 8: How To Create A Simple UserForm\"}]},{\"@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 8: How To Create A Simple UserForm - 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\/16\/vbastring-tip-8-how-to-create-a-simple-userform\/","og_locale":"en_US","og_type":"article","og_title":"VBAString Tip 8: How To Create A Simple UserForm - My Blog","og_description":"In this tip I am going to show you how to create a simple userform in Excel You are going to find out how to show the userform and transfer the data from your userform to your worksheet. If you want more advanced userform tips, click on the &#8220;UserForm&#8221; category on the right of the [&hellip;]","og_url":"https:\/\/vbastring.com\/blog\/2018\/11\/16\/vbastring-tip-8-how-to-create-a-simple-userform\/","og_site_name":"My Blog","article_published_time":"2018-11-16T18:08:14+00:00","article_modified_time":"2018-11-16T18:21:19+00:00","og_image":[{"url":"http:\/\/www.vbastring.com\/blog\/wp-content\/uploads\/2018\/11\/add_userform.png","type":"","width":"","height":""}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"Written by":"admin","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/vbastring.com\/blog\/2018\/11\/16\/vbastring-tip-8-how-to-create-a-simple-userform\/#article","isPartOf":{"@id":"https:\/\/vbastring.com\/blog\/2018\/11\/16\/vbastring-tip-8-how-to-create-a-simple-userform\/"},"author":{"name":"admin","@id":"https:\/\/vbastring.com\/blog\/#\/schema\/person\/e1de0b30e98940381697872449c341f5"},"headline":"VBAString Tip 8: How To Create A Simple UserForm","datePublished":"2018-11-16T18:08:14+00:00","dateModified":"2018-11-16T18:21:19+00:00","mainEntityOfPage":{"@id":"https:\/\/vbastring.com\/blog\/2018\/11\/16\/vbastring-tip-8-how-to-create-a-simple-userform\/"},"wordCount":143,"image":{"@id":"https:\/\/vbastring.com\/blog\/2018\/11\/16\/vbastring-tip-8-how-to-create-a-simple-userform\/#primaryimage"},"thumbnailUrl":"http:\/\/www.vbastring.com\/blog\/wp-content\/uploads\/2018\/11\/add_userform.png","inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/vbastring.com\/blog\/2018\/11\/16\/vbastring-tip-8-how-to-create-a-simple-userform\/","url":"https:\/\/vbastring.com\/blog\/2018\/11\/16\/vbastring-tip-8-how-to-create-a-simple-userform\/","name":"VBAString Tip 8: How To Create A Simple UserForm - My Blog","isPartOf":{"@id":"https:\/\/vbastring.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/vbastring.com\/blog\/2018\/11\/16\/vbastring-tip-8-how-to-create-a-simple-userform\/#primaryimage"},"image":{"@id":"https:\/\/vbastring.com\/blog\/2018\/11\/16\/vbastring-tip-8-how-to-create-a-simple-userform\/#primaryimage"},"thumbnailUrl":"http:\/\/www.vbastring.com\/blog\/wp-content\/uploads\/2018\/11\/add_userform.png","datePublished":"2018-11-16T18:08:14+00:00","dateModified":"2018-11-16T18:21:19+00:00","author":{"@id":"https:\/\/vbastring.com\/blog\/#\/schema\/person\/e1de0b30e98940381697872449c341f5"},"breadcrumb":{"@id":"https:\/\/vbastring.com\/blog\/2018\/11\/16\/vbastring-tip-8-how-to-create-a-simple-userform\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/vbastring.com\/blog\/2018\/11\/16\/vbastring-tip-8-how-to-create-a-simple-userform\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/vbastring.com\/blog\/2018\/11\/16\/vbastring-tip-8-how-to-create-a-simple-userform\/#primaryimage","url":"http:\/\/www.vbastring.com\/blog\/wp-content\/uploads\/2018\/11\/add_userform.png","contentUrl":"http:\/\/www.vbastring.com\/blog\/wp-content\/uploads\/2018\/11\/add_userform.png"},{"@type":"BreadcrumbList","@id":"https:\/\/vbastring.com\/blog\/2018\/11\/16\/vbastring-tip-8-how-to-create-a-simple-userform\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/vbastring.com\/blog\/"},{"@type":"ListItem","position":2,"name":"VBAString Tip 8: How To Create A Simple UserForm"}]},{"@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\/145","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=145"}],"version-history":[{"count":5,"href":"https:\/\/vbastring.com\/blog\/wp-json\/wp\/v2\/posts\/145\/revisions"}],"predecessor-version":[{"id":156,"href":"https:\/\/vbastring.com\/blog\/wp-json\/wp\/v2\/posts\/145\/revisions\/156"}],"wp:attachment":[{"href":"https:\/\/vbastring.com\/blog\/wp-json\/wp\/v2\/media?parent=145"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/vbastring.com\/blog\/wp-json\/wp\/v2\/categories?post=145"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/vbastring.com\/blog\/wp-json\/wp\/v2\/tags?post=145"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}