{"id":300,"date":"2019-01-12T17:45:26","date_gmt":"2019-01-12T17:45:26","guid":{"rendered":"http:\/\/www.vbastring.com\/blog\/?p=300"},"modified":"2019-01-12T18:30:10","modified_gmt":"2019-01-12T18:30:10","slug":"what-is-the-difference-between-combobox-and-listbox","status":"publish","type":"post","link":"https:\/\/vbastring.com\/blog\/2019\/01\/12\/what-is-the-difference-between-combobox-and-listbox\/","title":{"rendered":"What is the difference between ComboBox and ListBox?"},"content":{"rendered":"<p>The question here is &#8220;what is the difference between combobox and listbox?&#8221;<\/p>\n<p>Basically with a combobox you see one selected item at a time, and with a listbox you<br \/>\ncan see multiple items, and multiple selected items.<\/p>\n<p>Consider the following 2 examples, where you have a userform with 2 controls displaying the same data listed on a worksheet in the workbook:<\/p>\n<p><a href=\"https:\/\/i0.wp.com\/www.vbastring.com\/blog\/wp-content\/uploads\/2019\/01\/vba-excel-listbox-and-combo.xlsm-Excel-1.png\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.vbastring.com\/blog\/wp-content\/uploads\/2019\/01\/vba-excel-listbox-and-combo.xlsm-Excel-1.png?resize=671%2C358\" alt=\"\" width=\"671\" height=\"358\" class=\"alignleft size-full wp-image-310\" \/><\/a><\/p>\n<p>Both options show data from the same worksheet.  <strong>No matter how tall you make the combobox on the left, it is still going to only display 1 item.<\/strong>  You normally will only use this box to show 1 item.<\/p>\n<p>Here is the code:<\/p>\n<pre class=\"lang:vb decode:true \" >Private Sub UserForm_Initialize()\r\n    LoadBoxes\r\nEnd Sub\r\n\r\n\r\nSub LoadBoxes()\r\n    Dim intCounter As Integer\r\n    \r\n    'load combobox\r\n    With Me.cboSuppliers\r\n        .Clear\r\n        For intCounter = 1 To 132\r\n            .AddItem Sheets(\"Suppliers\").Cells(intCounter, 1).Value\r\n        Next intCounter\r\n    End With\r\n    \r\n    'load listbox\r\n    With Me.lstSuppliers\r\n        .Clear\r\n        For intCounter = 1 To 132\r\n            .AddItem Sheets(\"Suppliers\").Cells(intCounter, 1).Value\r\n        Next intCounter\r\n    End With\r\nEnd Sub\r\n<\/pre>\n<h2>ComboBox<\/h2>\n<p>The ComboBox shows only 1 entry despite the fact that there are multiples.<\/p>\n<p>The ComboBox is usually used when there is only 1 item to select.<\/p>\n<h2>ListBox<\/h2>\n<p>The ListBox shows every item in the list.<\/p>\n<p>The ListBox is usually used if you want to allow multiple selections or you want to show all the options possible to select.<\/p>\n<p>Watch this:<\/p>\n<p><iframe loading=\"lazy\" width=\"560\" height=\"315\" src=\"https:\/\/www.youtube.com\/embed\/8JoAo3Tycto\" frameborder=\"0\" allow=\"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen><\/iframe><\/p>\n<p><a href=\"http:\/\/www.vbastring.com\/blog\/contact-me\/\" rel=\"noopener\" target=\"_blank\">Let me know if you have any questions.<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The question here is &#8220;what is the difference between combobox and listbox?&#8221; Basically with a combobox you see one selected item at a time, and with a listbox you can see multiple items, and multiple selected items. Consider the following 2 examples, where you have a userform with 2 controls displaying the same data listed [&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-300","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>What is the difference between ComboBox and ListBox? - 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\/2019\/01\/12\/what-is-the-difference-between-combobox-and-listbox\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"What is the difference between ComboBox and ListBox? - My Blog\" \/>\n<meta property=\"og:description\" content=\"The question here is &#8220;what is the difference between combobox and listbox?&#8221; Basically with a combobox you see one selected item at a time, and with a listbox you can see multiple items, and multiple selected items. Consider the following 2 examples, where you have a userform with 2 controls displaying the same data listed [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/vbastring.com\/blog\/2019\/01\/12\/what-is-the-difference-between-combobox-and-listbox\/\" \/>\n<meta property=\"og:site_name\" content=\"My Blog\" \/>\n<meta property=\"article:published_time\" content=\"2019-01-12T17:45:26+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-01-12T18:30:10+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/www.vbastring.com\/blog\/wp-content\/uploads\/2019\/01\/vba-excel-listbox-and-combo.xlsm-Excel-1.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\\\/2019\\\/01\\\/12\\\/what-is-the-difference-between-combobox-and-listbox\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/vbastring.com\\\/blog\\\/2019\\\/01\\\/12\\\/what-is-the-difference-between-combobox-and-listbox\\\/\"},\"author\":{\"name\":\"admin\",\"@id\":\"https:\\\/\\\/vbastring.com\\\/blog\\\/#\\\/schema\\\/person\\\/e1de0b30e98940381697872449c341f5\"},\"headline\":\"What is the difference between ComboBox and ListBox?\",\"datePublished\":\"2019-01-12T17:45:26+00:00\",\"dateModified\":\"2019-01-12T18:30:10+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/vbastring.com\\\/blog\\\/2019\\\/01\\\/12\\\/what-is-the-difference-between-combobox-and-listbox\\\/\"},\"wordCount\":175,\"image\":{\"@id\":\"https:\\\/\\\/vbastring.com\\\/blog\\\/2019\\\/01\\\/12\\\/what-is-the-difference-between-combobox-and-listbox\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/www.vbastring.com\\\/blog\\\/wp-content\\\/uploads\\\/2019\\\/01\\\/vba-excel-listbox-and-combo.xlsm-Excel-1.png\",\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/vbastring.com\\\/blog\\\/2019\\\/01\\\/12\\\/what-is-the-difference-between-combobox-and-listbox\\\/\",\"url\":\"https:\\\/\\\/vbastring.com\\\/blog\\\/2019\\\/01\\\/12\\\/what-is-the-difference-between-combobox-and-listbox\\\/\",\"name\":\"What is the difference between ComboBox and ListBox? - My Blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/vbastring.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/vbastring.com\\\/blog\\\/2019\\\/01\\\/12\\\/what-is-the-difference-between-combobox-and-listbox\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/vbastring.com\\\/blog\\\/2019\\\/01\\\/12\\\/what-is-the-difference-between-combobox-and-listbox\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/www.vbastring.com\\\/blog\\\/wp-content\\\/uploads\\\/2019\\\/01\\\/vba-excel-listbox-and-combo.xlsm-Excel-1.png\",\"datePublished\":\"2019-01-12T17:45:26+00:00\",\"dateModified\":\"2019-01-12T18:30:10+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/vbastring.com\\\/blog\\\/#\\\/schema\\\/person\\\/e1de0b30e98940381697872449c341f5\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/vbastring.com\\\/blog\\\/2019\\\/01\\\/12\\\/what-is-the-difference-between-combobox-and-listbox\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/vbastring.com\\\/blog\\\/2019\\\/01\\\/12\\\/what-is-the-difference-between-combobox-and-listbox\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/vbastring.com\\\/blog\\\/2019\\\/01\\\/12\\\/what-is-the-difference-between-combobox-and-listbox\\\/#primaryimage\",\"url\":\"http:\\\/\\\/www.vbastring.com\\\/blog\\\/wp-content\\\/uploads\\\/2019\\\/01\\\/vba-excel-listbox-and-combo.xlsm-Excel-1.png\",\"contentUrl\":\"http:\\\/\\\/www.vbastring.com\\\/blog\\\/wp-content\\\/uploads\\\/2019\\\/01\\\/vba-excel-listbox-and-combo.xlsm-Excel-1.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/vbastring.com\\\/blog\\\/2019\\\/01\\\/12\\\/what-is-the-difference-between-combobox-and-listbox\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/vbastring.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"What is the difference between ComboBox and ListBox?\"}]},{\"@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":"What is the difference between ComboBox and ListBox? - 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\/2019\/01\/12\/what-is-the-difference-between-combobox-and-listbox\/","og_locale":"en_US","og_type":"article","og_title":"What is the difference between ComboBox and ListBox? - My Blog","og_description":"The question here is &#8220;what is the difference between combobox and listbox?&#8221; Basically with a combobox you see one selected item at a time, and with a listbox you can see multiple items, and multiple selected items. Consider the following 2 examples, where you have a userform with 2 controls displaying the same data listed [&hellip;]","og_url":"https:\/\/vbastring.com\/blog\/2019\/01\/12\/what-is-the-difference-between-combobox-and-listbox\/","og_site_name":"My Blog","article_published_time":"2019-01-12T17:45:26+00:00","article_modified_time":"2019-01-12T18:30:10+00:00","og_image":[{"url":"http:\/\/www.vbastring.com\/blog\/wp-content\/uploads\/2019\/01\/vba-excel-listbox-and-combo.xlsm-Excel-1.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\/2019\/01\/12\/what-is-the-difference-between-combobox-and-listbox\/#article","isPartOf":{"@id":"https:\/\/vbastring.com\/blog\/2019\/01\/12\/what-is-the-difference-between-combobox-and-listbox\/"},"author":{"name":"admin","@id":"https:\/\/vbastring.com\/blog\/#\/schema\/person\/e1de0b30e98940381697872449c341f5"},"headline":"What is the difference between ComboBox and ListBox?","datePublished":"2019-01-12T17:45:26+00:00","dateModified":"2019-01-12T18:30:10+00:00","mainEntityOfPage":{"@id":"https:\/\/vbastring.com\/blog\/2019\/01\/12\/what-is-the-difference-between-combobox-and-listbox\/"},"wordCount":175,"image":{"@id":"https:\/\/vbastring.com\/blog\/2019\/01\/12\/what-is-the-difference-between-combobox-and-listbox\/#primaryimage"},"thumbnailUrl":"http:\/\/www.vbastring.com\/blog\/wp-content\/uploads\/2019\/01\/vba-excel-listbox-and-combo.xlsm-Excel-1.png","inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/vbastring.com\/blog\/2019\/01\/12\/what-is-the-difference-between-combobox-and-listbox\/","url":"https:\/\/vbastring.com\/blog\/2019\/01\/12\/what-is-the-difference-between-combobox-and-listbox\/","name":"What is the difference between ComboBox and ListBox? - My Blog","isPartOf":{"@id":"https:\/\/vbastring.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/vbastring.com\/blog\/2019\/01\/12\/what-is-the-difference-between-combobox-and-listbox\/#primaryimage"},"image":{"@id":"https:\/\/vbastring.com\/blog\/2019\/01\/12\/what-is-the-difference-between-combobox-and-listbox\/#primaryimage"},"thumbnailUrl":"http:\/\/www.vbastring.com\/blog\/wp-content\/uploads\/2019\/01\/vba-excel-listbox-and-combo.xlsm-Excel-1.png","datePublished":"2019-01-12T17:45:26+00:00","dateModified":"2019-01-12T18:30:10+00:00","author":{"@id":"https:\/\/vbastring.com\/blog\/#\/schema\/person\/e1de0b30e98940381697872449c341f5"},"breadcrumb":{"@id":"https:\/\/vbastring.com\/blog\/2019\/01\/12\/what-is-the-difference-between-combobox-and-listbox\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/vbastring.com\/blog\/2019\/01\/12\/what-is-the-difference-between-combobox-and-listbox\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/vbastring.com\/blog\/2019\/01\/12\/what-is-the-difference-between-combobox-and-listbox\/#primaryimage","url":"http:\/\/www.vbastring.com\/blog\/wp-content\/uploads\/2019\/01\/vba-excel-listbox-and-combo.xlsm-Excel-1.png","contentUrl":"http:\/\/www.vbastring.com\/blog\/wp-content\/uploads\/2019\/01\/vba-excel-listbox-and-combo.xlsm-Excel-1.png"},{"@type":"BreadcrumbList","@id":"https:\/\/vbastring.com\/blog\/2019\/01\/12\/what-is-the-difference-between-combobox-and-listbox\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/vbastring.com\/blog\/"},{"@type":"ListItem","position":2,"name":"What is the difference between ComboBox and ListBox?"}]},{"@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\/300","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=300"}],"version-history":[{"count":5,"href":"https:\/\/vbastring.com\/blog\/wp-json\/wp\/v2\/posts\/300\/revisions"}],"predecessor-version":[{"id":314,"href":"https:\/\/vbastring.com\/blog\/wp-json\/wp\/v2\/posts\/300\/revisions\/314"}],"wp:attachment":[{"href":"https:\/\/vbastring.com\/blog\/wp-json\/wp\/v2\/media?parent=300"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/vbastring.com\/blog\/wp-json\/wp\/v2\/categories?post=300"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/vbastring.com\/blog\/wp-json\/wp\/v2\/tags?post=300"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}