{"id":77,"date":"2018-10-30T15:41:49","date_gmt":"2018-10-30T15:41:49","guid":{"rendered":"http:\/\/www.vbastring.com\/blog\/?p=77"},"modified":"2018-10-30T15:49:30","modified_gmt":"2018-10-30T15:49:30","slug":"vba-combobox","status":"publish","type":"post","link":"https:\/\/vbastring.com\/blog\/2018\/10\/30\/vba-combobox\/","title":{"rendered":"VBA Combobox"},"content":{"rendered":"<p><strong>This is a text and video example of how to implement a VBA Combobox:<\/strong><\/p>\n<p>On your Excel worksheet show your &#8220;Control Toolbar&#8221;. In Excel 2003 and prior, right click the standard toolbar (at the top of your screen) and choose &#8220;Control Toolbar&#8221;. In Excel 2007 and above click the round Microsoft Office Button at the top left or your screen. Then choose &#8220;Excel Options&#8221; at the bottom of the list. The choose &#8220;Developer&#8221; and select to show the developer toolbar.<\/p>\n<p>Add combo box to your worksheet, then choose to show the properties. Key in &#8220;A1&#8221; for the linked cell. Call one of your worksheets &#8220;data&#8221;, and for &#8220;ListFillRange&#8221; enter &#8220;data!A2:A5&#8221; (that&#8217;s the naming structure [worksheet name]![cell range]). Make sure you enter some values into the sheet called &#8220;data&#8221; and cells &#8220;A2-A5&#8221; or else you won&#8217;t show anything in your new combobox.<br \/>\nThis is what your worksheet should look like:<br \/>\nCell A2 = &#8220;red&#8221;<br \/>\nCell A3 = &#8220;blue&#8221;<br \/>\nCell A4 = &#8220;black&#8221;<br \/>\nCell A5 = &#8220;yellow&#8221;<br \/>\nNext &#8211; add some code to the &#8220;Change&#8221; event of the combobox. You will analyze the value of the changed item in the combobox.<\/p>\n<p>It&#8217;s going to look like this, and you&#8217;ll have to apply the principles to your situation:<br \/>\n******************************************************************* <\/p>\n<pre class=\"lang:vb decode:true \" >Private Sub cboColors_Change()\r\n   Dim strColor As String\r\n\r\n   strColor = Me.cboColors\r\n   strColor = Trim(strColor)\r\n\r\n   Select Case strColor\r\n      Case \"blue\"\r\n         MsgBox \"blue\"\r\n      Case \"black\"\r\n         MsgBox \"black\"\r\n      Case Else\r\n         MsgBox Me.cboColors\r\n      End Select\r\n   End Sub\t\r\n<\/pre>\n<p>*********************************************************************<br \/>\nNow watch how it&#8217;s done&#8230;<\/p>\n<p><iframe loading=\"lazy\" title=\"YouTube video player\" width=\"480\" height=\"390\" src=\"http:\/\/www.youtube.com\/embed\/rdkAZV-To3s\" frameborder=\"0\" 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 a text and video example of how to implement a VBA Combobox: On your Excel worksheet show your &#8220;Control Toolbar&#8221;. In Excel 2003 and prior, right click the standard toolbar (at the top of your screen) and choose &#8220;Control Toolbar&#8221;. In Excel 2007 and above click the round Microsoft Office Button at 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-77","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>VBA Combobox - 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\/10\/30\/vba-combobox\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"VBA Combobox - My Blog\" \/>\n<meta property=\"og:description\" content=\"This is a text and video example of how to implement a VBA Combobox: On your Excel worksheet show your &#8220;Control Toolbar&#8221;. In Excel 2003 and prior, right click the standard toolbar (at the top of your screen) and choose &#8220;Control Toolbar&#8221;. In Excel 2007 and above click the round Microsoft Office Button at the [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/vbastring.com\/blog\/2018\/10\/30\/vba-combobox\/\" \/>\n<meta property=\"og:site_name\" content=\"My Blog\" \/>\n<meta property=\"article:published_time\" content=\"2018-10-30T15:41:49+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2018-10-30T15:49:30+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\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\\\/10\\\/30\\\/vba-combobox\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/vbastring.com\\\/blog\\\/2018\\\/10\\\/30\\\/vba-combobox\\\/\"},\"author\":{\"name\":\"admin\",\"@id\":\"https:\\\/\\\/vbastring.com\\\/blog\\\/#\\\/schema\\\/person\\\/e1de0b30e98940381697872449c341f5\"},\"headline\":\"VBA Combobox\",\"datePublished\":\"2018-10-30T15:41:49+00:00\",\"dateModified\":\"2018-10-30T15:49:30+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/vbastring.com\\\/blog\\\/2018\\\/10\\\/30\\\/vba-combobox\\\/\"},\"wordCount\":226,\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/vbastring.com\\\/blog\\\/2018\\\/10\\\/30\\\/vba-combobox\\\/\",\"url\":\"https:\\\/\\\/vbastring.com\\\/blog\\\/2018\\\/10\\\/30\\\/vba-combobox\\\/\",\"name\":\"VBA Combobox - My Blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/vbastring.com\\\/blog\\\/#website\"},\"datePublished\":\"2018-10-30T15:41:49+00:00\",\"dateModified\":\"2018-10-30T15:49:30+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/vbastring.com\\\/blog\\\/#\\\/schema\\\/person\\\/e1de0b30e98940381697872449c341f5\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/vbastring.com\\\/blog\\\/2018\\\/10\\\/30\\\/vba-combobox\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/vbastring.com\\\/blog\\\/2018\\\/10\\\/30\\\/vba-combobox\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/vbastring.com\\\/blog\\\/2018\\\/10\\\/30\\\/vba-combobox\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/vbastring.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"VBA Combobox\"}]},{\"@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":"VBA Combobox - 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\/10\/30\/vba-combobox\/","og_locale":"en_US","og_type":"article","og_title":"VBA Combobox - My Blog","og_description":"This is a text and video example of how to implement a VBA Combobox: On your Excel worksheet show your &#8220;Control Toolbar&#8221;. In Excel 2003 and prior, right click the standard toolbar (at the top of your screen) and choose &#8220;Control Toolbar&#8221;. In Excel 2007 and above click the round Microsoft Office Button at the [&hellip;]","og_url":"https:\/\/vbastring.com\/blog\/2018\/10\/30\/vba-combobox\/","og_site_name":"My Blog","article_published_time":"2018-10-30T15:41:49+00:00","article_modified_time":"2018-10-30T15:49:30+00:00","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\/10\/30\/vba-combobox\/#article","isPartOf":{"@id":"https:\/\/vbastring.com\/blog\/2018\/10\/30\/vba-combobox\/"},"author":{"name":"admin","@id":"https:\/\/vbastring.com\/blog\/#\/schema\/person\/e1de0b30e98940381697872449c341f5"},"headline":"VBA Combobox","datePublished":"2018-10-30T15:41:49+00:00","dateModified":"2018-10-30T15:49:30+00:00","mainEntityOfPage":{"@id":"https:\/\/vbastring.com\/blog\/2018\/10\/30\/vba-combobox\/"},"wordCount":226,"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/vbastring.com\/blog\/2018\/10\/30\/vba-combobox\/","url":"https:\/\/vbastring.com\/blog\/2018\/10\/30\/vba-combobox\/","name":"VBA Combobox - My Blog","isPartOf":{"@id":"https:\/\/vbastring.com\/blog\/#website"},"datePublished":"2018-10-30T15:41:49+00:00","dateModified":"2018-10-30T15:49:30+00:00","author":{"@id":"https:\/\/vbastring.com\/blog\/#\/schema\/person\/e1de0b30e98940381697872449c341f5"},"breadcrumb":{"@id":"https:\/\/vbastring.com\/blog\/2018\/10\/30\/vba-combobox\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/vbastring.com\/blog\/2018\/10\/30\/vba-combobox\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/vbastring.com\/blog\/2018\/10\/30\/vba-combobox\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/vbastring.com\/blog\/"},{"@type":"ListItem","position":2,"name":"VBA Combobox"}]},{"@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\/77","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=77"}],"version-history":[{"count":3,"href":"https:\/\/vbastring.com\/blog\/wp-json\/wp\/v2\/posts\/77\/revisions"}],"predecessor-version":[{"id":82,"href":"https:\/\/vbastring.com\/blog\/wp-json\/wp\/v2\/posts\/77\/revisions\/82"}],"wp:attachment":[{"href":"https:\/\/vbastring.com\/blog\/wp-json\/wp\/v2\/media?parent=77"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/vbastring.com\/blog\/wp-json\/wp\/v2\/categories?post=77"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/vbastring.com\/blog\/wp-json\/wp\/v2\/tags?post=77"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}