{"id":404,"date":"2019-01-25T04:56:54","date_gmt":"2019-01-25T04:56:54","guid":{"rendered":"http:\/\/www.vbastring.com\/blog\/?p=404"},"modified":"2019-01-29T04:11:18","modified_gmt":"2019-01-29T04:11:18","slug":"how-to-set-up-cascading-combo-boxes-on-an-excel-vba-userform","status":"publish","type":"post","link":"https:\/\/vbastring.com\/blog\/2019\/01\/25\/how-to-set-up-cascading-combo-boxes-on-an-excel-vba-userform\/","title":{"rendered":"How To Set Up Cascading Combo Boxes On An Excel VBA Userform"},"content":{"rendered":"<p>Hi everyone, in the previous post <\/p>\n<p><strong><a href=\"http:\/\/www.vbastring.com\/blog\/how-to-make-a-basic-excel-vba-userform-search-box\/\" rel=\"noopener\" target=\"_blank\">How To Make A Basic Excel VBA UserForm Search Box<\/a><\/strong><\/p>\n<p>I showed how to create a search form based on three columns, but<br \/>\nthe issue with it was that it shows all the items in the column, and<br \/>\ndoesn&#8217;t filter the data based on the previous selection.<\/p>\n<p>In this post I will show you how to limit your selection based on the previous selection.<\/p>\n<p><strong>For example, here you see a sorted list of unique years:<\/strong><br \/>\n<a href=\"https:\/\/i0.wp.com\/www.vbastring.com\/blog\/wp-content\/uploads\/2019\/01\/cascading_combo_boxes_excel_vba_userform.png\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.vbastring.com\/blog\/wp-content\/uploads\/2019\/01\/cascading_combo_boxes_excel_vba_userform.png?resize=710%2C480\" alt=\"\" width=\"710\" height=\"480\" class=\"alignleft size-full wp-image-407\" \/><\/a><\/p>\n<p>Here you&#8217;ll see the makes that belong to those years:<br \/>\n<a href=\"https:\/\/i0.wp.com\/www.vbastring.com\/blog\/wp-content\/uploads\/2019\/01\/cascading_combo_boxes_excel_vba_userform2.png\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.vbastring.com\/blog\/wp-content\/uploads\/2019\/01\/cascading_combo_boxes_excel_vba_userform2.png?resize=1279%2C583\" alt=\"\" width=\"1279\" height=\"583\" class=\"alignleft size-full wp-image-409\" \/><\/a><\/p>\n<p>We are going to be using the ADO library which makes this very easy and straight forward.<\/p>\n<p>With ADO we don&#8217;t have to write extra code for selecting only unique values and sorting the list items.<br \/>\nWe&#8217;ll let ADO do the &#8220;heavy lifting&#8221; for us so we don&#8217;t have to write so much code.<\/p>\n<p><strong>I&#8217;ll compare the 2 ways of writing this in another post.<\/strong><\/p>\n<p>Before we were using the &#8220;LoadBoxes&#8221; procedure which was loading all the combo boxes without ADO.<\/p>\n<p>When we initialize the UserForm we are loading all the comboboxes with unique values:<\/p>\n<pre class=\"lang:vb decode:true \" >Private Sub UserForm_Initialize()\r\n    'LoadBoxes\r\n    \r\n    LoadYears\r\n    LoadMakes\r\n    LoadModels\r\n    \r\nEnd Sub\r\n\r\nPrivate Sub LoadYears()\r\n    'Purpose: Load combo with unique years\r\n    \r\n    Dim cnn As Object\r\n    Dim rst As Object\r\n    Dim strSQL As String\r\n    Dim lngCount As Long\r\n    Dim intCounter As Integer\r\n    \r\n    Me.cboYear.Clear\r\n    \r\n    'Set up the connection to the Excel worksheet\r\n    Set cnn = CreateObject(\"ADODB.Connection\")\r\n    With cnn\r\n        .Provider = \"Microsoft.ACE.OLEDB.12.0\"\r\n        .ConnectionString = \"Data Source=\" &amp; ThisWorkbook.Path &amp; \"\\\" &amp; ThisWorkbook.Name &amp; \";\" &amp; _\r\n            \"Extended Properties=\"\"Excel 12.0 Xml;HDR=YES\"\";\"\r\n        .Open\r\n    End With\r\n        \r\n    'In order to do queries with a WHERE clause, you need to name the range, otherwise use the worksheet name.\r\n   \r\n    strSQL = \"SELECT DISTINCT [Year] FROM [newtable] ORDER BY [Year]\"\r\n    \r\n    Set rst = cnn.Execute(strSQL)\r\n    \r\n    lngCount = 0\r\n    \r\n    If Not rst.EOF Then\r\n        Do Until rst.EOF\r\n            Me.cboYear.AddItem rst(0)\r\n               \r\n           lngCount = lngCount + 1\r\n           rst.Movenext\r\n        Loop\r\n        \r\n        rst.Close\r\n        Set rst = Nothing\r\n        cnn.Close\r\n        Set cnn = Nothing\r\n    \r\n    Else\r\n    \r\n        Me.lblMessage.Caption = \"No data found based on your selections.\"\r\n        DoEvents\r\n    End If\r\n\r\n    \r\nEnd Sub\r\n\r\nPrivate Sub LoadMakes()\r\n    'Purpose: Load combo with unique makes\r\n    \r\n    Dim cnn As Object\r\n    Dim rst As Object\r\n    Dim strSQL As String\r\n    Dim lngCount As Long\r\n    Dim intCounter As Integer\r\n    \r\n    Me.cboMake.Clear\r\n    \r\n    'Set up the connection to the Excel worksheet\r\n    Set cnn = CreateObject(\"ADODB.Connection\")\r\n    With cnn\r\n        .Provider = \"Microsoft.ACE.OLEDB.12.0\"\r\n        .ConnectionString = \"Data Source=\" &amp; ThisWorkbook.Path &amp; \"\\\" &amp; ThisWorkbook.Name &amp; \";\" &amp; _\r\n            \"Extended Properties=\"\"Excel 12.0 Xml;HDR=YES\"\";\"\r\n        .Open\r\n    End With\r\n        \r\n    'In order to do queries with a WHERE clause, you need to name the range, otherwise use the worksheet name.\r\n   \r\n    strSQL = \"SELECT DISTINCT [Make] FROM [newtable] ORDER BY [Make]\"\r\n    \r\n    Set rst = cnn.Execute(strSQL)\r\n    \r\n    lngCount = 0\r\n    \r\n    If Not rst.EOF Then\r\n        Do Until rst.EOF\r\n            Me.cboMake.AddItem rst(0)\r\n               \r\n           lngCount = lngCount + 1\r\n           rst.Movenext\r\n        Loop\r\n        \r\n        rst.Close\r\n        Set rst = Nothing\r\n        cnn.Close\r\n        Set cnn = Nothing\r\n    Else\r\n    \r\n        Me.lblMessage.Caption = \"No data found based on your selections.\"\r\n        DoEvents\r\n    End If\r\n\r\n    \r\nEnd Sub\r\n\r\n\r\nPrivate Sub LoadModels()\r\n    'Purpose: Load combo with unique makes\r\n    \r\n    Dim cnn As Object\r\n    Dim rst As Object\r\n    Dim strSQL As String\r\n    Dim lngCount As Long\r\n    Dim intCounter As Integer\r\n    \r\n    Me.cboModel.Clear\r\n    \r\n    'Set up the connection to the Excel worksheet\r\n    Set cnn = CreateObject(\"ADODB.Connection\")\r\n    With cnn\r\n        .Provider = \"Microsoft.ACE.OLEDB.12.0\"\r\n        .ConnectionString = \"Data Source=\" &amp; ThisWorkbook.Path &amp; \"\\\" &amp; ThisWorkbook.Name &amp; \";\" &amp; _\r\n            \"Extended Properties=\"\"Excel 12.0 Xml;HDR=YES\"\";\"\r\n        .Open\r\n    End With\r\n        \r\n    'In order to do queries with a WHERE clause, you need to name the range, otherwise use the worksheet name.\r\n    \r\n    strSQL = \"SELECT DISTINCT [Model] FROM [newtable] ORDER BY [Model]\"\r\n    \r\n    Set rst = cnn.Execute(strSQL)\r\n    \r\n    lngCount = 0\r\n    \r\n    If Not rst.EOF Then\r\n        Do Until rst.EOF\r\n            Me.cboModel.AddItem rst(0)\r\n               \r\n           lngCount = lngCount + 1\r\n           rst.Movenext\r\n        Loop\r\n        \r\n        rst.Close\r\n        Set rst = Nothing\r\n        cnn.Close\r\n        Set cnn = Nothing\r\n    Else\r\n    \r\n        Me.lblMessage.Caption = \"No data found based on your selections.\"\r\n        DoEvents\r\n    End If\r\n\r\n    \r\nEnd Sub<\/pre>\n<p><strong>We&#8217;ll use the combo box&#8217;s &#8220;Change&#8221; event to get the pass the combo box&#8217;s value to load the correct values on the others.<\/strong><\/p>\n<h2>First when the year changes:<\/h2>\n<pre class=\"lang:vb decode:true \" >\r\nPrivate Sub cboYear_Change()\r\n    'MsgBox \"change model for \" &amp; Me.cboYear.Value\r\n    ChangeMakes Me.cboYear.Value\r\n    \r\nEnd Sub\r\n\r\nPrivate Sub ChangeMakes(year)\r\n    'Purpose: Load combo with unique makes\r\n    \r\n    Dim cnn As Object\r\n    Dim rst As Object\r\n    Dim strSQL As String\r\n    Dim lngCount As Long\r\n    Dim intCounter As Integer\r\n    \r\n    \r\n    If year = \"\" Then Exit Sub\r\n    \r\n    Me.cboMake.Clear\r\n    \r\n    'Set up the connection to the Excel worksheet\r\n    Set cnn = CreateObject(\"ADODB.Connection\")\r\n    With cnn\r\n        .Provider = \"Microsoft.ACE.OLEDB.12.0\"\r\n        .ConnectionString = \"Data Source=\" &amp; ThisWorkbook.Path &amp; \"\\\" &amp; ThisWorkbook.Name &amp; \";\" &amp; _\r\n            \"Extended Properties=\"\"Excel 12.0 Xml;HDR=YES\"\";\"\r\n        .Open\r\n    End With\r\n        \r\n    'In order to do queries with a WHERE clause, you need to name the range, otherwise use the worksheet name.\r\n   \r\n    strSQL = \"SELECT DISTINCT [Make] FROM [newtable] WHERE Year= \" &amp; year &amp; \" ORDER BY [Make]\"\r\n    \r\n    Set rst = cnn.Execute(strSQL)\r\n    \r\n    lngCount = 0\r\n    \r\n    If Not rst.EOF Then\r\n        Do Until rst.EOF\r\n            Me.cboMake.AddItem rst(0)\r\n               \r\n           lngCount = lngCount + 1\r\n           rst.Movenext\r\n        Loop\r\n        \r\n        rst.Close\r\n        Set rst = Nothing\r\n        cnn.Close\r\n        Set cnn = Nothing\r\n    Else\r\n    \r\n        Me.lblMessage.Caption = \"No data found based on your selections.\"\r\n        DoEvents\r\n    End If\r\n\r\n    \r\nEnd Sub<\/pre>\n<h2>Second when the make changes, we want to update the models:<\/h2>\n<pre class=\"lang:vb decode:true \" >Private Sub cboMake_Change()\r\n    ChangeModels Me.cboYear.Value, Me.cboMake.Value\r\nEnd Sub\r\n\r\n    'Purpose: Load combo with unique makes\r\n    \r\n    Dim cnn As Object\r\n    Dim rst As Object\r\n    Dim strSQL As String\r\n    Dim lngCount As Long\r\n    Dim intCounter As Integer\r\n    \r\n    If year = \"\" And make = \"\" Then Exit Sub\r\n    \r\n    \r\n    Me.cboModel.Clear\r\n    \r\n    'Set up the connection to the Excel worksheet\r\n    Set cnn = CreateObject(\"ADODB.Connection\")\r\n    With cnn\r\n        .Provider = \"Microsoft.ACE.OLEDB.12.0\"\r\n        .ConnectionString = \"Data Source=\" &amp; ThisWorkbook.Path &amp; \"\\\" &amp; ThisWorkbook.Name &amp; \";\" &amp; _\r\n            \"Extended Properties=\"\"Excel 12.0 Xml;HDR=YES\"\";\"\r\n        .Open\r\n    End With\r\n        \r\n    'In order to do queries with a WHERE clause, you need to name the range, otherwise use the worksheet name.\r\n    \r\n    strSQL = \"SELECT DISTINCT [Model] FROM [newtable] WHERE [Year] =\" &amp; year &amp; \" AND [Make] = '\" &amp; make &amp; \"' ORDER BY Model\"\r\n\r\n    Set rst = cnn.Execute(strSQL)\r\n    \r\n    lngCount = 0\r\n    \r\n    If Not rst.EOF Then\r\n        Do Until rst.EOF\r\n            Me.cboModel.AddItem rst(0)\r\n               \r\n           lngCount = lngCount + 1\r\n           rst.Movenext\r\n        Loop\r\n        \r\n        rst.Close\r\n        Set rst = Nothing\r\n        cnn.Close\r\n        Set cnn = Nothing\r\n    Else\r\n    \r\n        Me.lblMessage.Caption = \"No data found based on your selections.\"\r\n        DoEvents\r\n    End If\r\n\r\n    \r\nEnd Sub<\/pre>\n<h2>So now when we search, we&#8217;ll always have a result!<\/h2>\n<pre class=\"lang:vb decode:true \" >    'Purpose: Find the item on the screen based on the textbox selections\r\n    \r\n    Dim cnn As Object\r\n    Dim rst As Object\r\n    Dim strSQL As String\r\n    Dim lngCount As Long\r\n    \r\n    'Set up the connection to the Excel worksheet\r\n    Set cnn = CreateObject(\"ADODB.Connection\")\r\n    With cnn\r\n        .Provider = \"Microsoft.ACE.OLEDB.12.0\"\r\n        .ConnectionString = \"Data Source=\" &amp; ThisWorkbook.Path &amp; \"\\\" &amp; ThisWorkbook.Name &amp; \";\" &amp; _\r\n            \"Extended Properties=\"\"Excel 12.0 Xml;HDR=YES\"\";\"\r\n        .Open\r\n    End With\r\n    \r\n    \r\n    'In order to do queries with a WHERE clause, you need to name the range, otherwise use the worksheet name.\r\n    'strSQL = \"SELECT * FROM [Sheet1$]\"\r\n    strSQL = \"SELECT * FROM [newtable] WHERE [Year] =\" &amp; Me.cboYear &amp; \" AND [Make] = '\" &amp; Me.cboMake &amp; \"' AND [Model] = '\" &amp; Me.cboModel &amp; \"'\"\r\n\r\n    Set rst = cnn.Execute(strSQL)\r\n    \r\n    lngCount = 0\r\n    \r\n    If Not rst.EOF Then\r\n        Do Until rst.EOF\r\n           'output = output &amp; rst(0) &amp; \";\" &amp; rst(1) &amp; \";\" &amp; rst(2) &amp; vbNewLine\r\n           'Debug.Print rst(0); \";\" &amp; rst(1) &amp; \";\" &amp; rst(2)\r\n           \r\n           lngCount = lngCount + 1\r\n           rst.Movenext\r\n        Loop\r\n        \r\n        rst.Close\r\n        Set rst = Nothing\r\n        cnn.Close\r\n        Set cnn = Nothing\r\n        \r\n        Me.lblMessage.Caption = lngCount &amp; \" record(s) found based on your selections.\"\r\n        DoEvents\r\n    Else\r\n    \r\n        Me.lblMessage.Caption = \"No data found based on your selections.\"\r\n        DoEvents\r\n    End If\r\n\r\n    \r\nEnd Sub\r\n<\/pre>\n<p>Watch how it&#8217;s done:<\/p>\n<p><iframe loading=\"lazy\" width=\"560\" height=\"315\" src=\"https:\/\/www.youtube.com\/embed\/WeXBCH3ooJs\" frameborder=\"0\" allow=\"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen><\/iframe><\/p>\n<p><a href=\"https:\/\/i0.wp.com\/www.vbastring.com\/blog\/wp-content\/uploads\/2019\/01\/cascading_combo_boxes_excel_vba_userform3.png\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.vbastring.com\/blog\/wp-content\/uploads\/2019\/01\/cascading_combo_boxes_excel_vba_userform3.png?resize=693%2C469\" alt=\"\" width=\"693\" height=\"469\" class=\"alignleft size-full wp-image-412\" \/><\/a><br \/>\nLet me know if you have any questions.<\/p>\n<p><a href=\"http:\/\/www.getyourboomback.com\/#_l_2pn\"><img data-recalc-dims=\"1\" height=\"580\" width=\"580\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/leaddyno-client-images.s3.amazonaws.com\/cffa678c5db61bb2476a50e2198c69454765190c\/6bc94a38828c6e5e788052b1673c62aecb0d487b_aminoboosters-YTE-square-2bottles-580x580.png?resize=580%2C580&#038;ssl=1\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hi everyone, in the previous post How To Make A Basic Excel VBA UserForm Search Box I showed how to create a search form based on three columns, but the issue with it was that it shows all the items in the column, and doesn&#8217;t filter the data based on the previous selection. In this [&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-404","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>How To Set Up Cascading Combo Boxes On An Excel VBA 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\/2019\/01\/25\/how-to-set-up-cascading-combo-boxes-on-an-excel-vba-userform\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How To Set Up Cascading Combo Boxes On An Excel VBA Userform - My Blog\" \/>\n<meta property=\"og:description\" content=\"Hi everyone, in the previous post How To Make A Basic Excel VBA UserForm Search Box I showed how to create a search form based on three columns, but the issue with it was that it shows all the items in the column, and doesn&#8217;t filter the data based on the previous selection. In this [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/vbastring.com\/blog\/2019\/01\/25\/how-to-set-up-cascading-combo-boxes-on-an-excel-vba-userform\/\" \/>\n<meta property=\"og:site_name\" content=\"My Blog\" \/>\n<meta property=\"article:published_time\" content=\"2019-01-25T04:56:54+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-01-29T04:11:18+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/www.vbastring.com\/blog\/wp-content\/uploads\/2019\/01\/cascading_combo_boxes_excel_vba_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=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/vbastring.com\\\/blog\\\/2019\\\/01\\\/25\\\/how-to-set-up-cascading-combo-boxes-on-an-excel-vba-userform\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/vbastring.com\\\/blog\\\/2019\\\/01\\\/25\\\/how-to-set-up-cascading-combo-boxes-on-an-excel-vba-userform\\\/\"},\"author\":{\"name\":\"admin\",\"@id\":\"https:\\\/\\\/vbastring.com\\\/blog\\\/#\\\/schema\\\/person\\\/e1de0b30e98940381697872449c341f5\"},\"headline\":\"How To Set Up Cascading Combo Boxes On An Excel VBA Userform\",\"datePublished\":\"2019-01-25T04:56:54+00:00\",\"dateModified\":\"2019-01-29T04:11:18+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/vbastring.com\\\/blog\\\/2019\\\/01\\\/25\\\/how-to-set-up-cascading-combo-boxes-on-an-excel-vba-userform\\\/\"},\"wordCount\":269,\"image\":{\"@id\":\"https:\\\/\\\/vbastring.com\\\/blog\\\/2019\\\/01\\\/25\\\/how-to-set-up-cascading-combo-boxes-on-an-excel-vba-userform\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/www.vbastring.com\\\/blog\\\/wp-content\\\/uploads\\\/2019\\\/01\\\/cascading_combo_boxes_excel_vba_userform.png\",\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/vbastring.com\\\/blog\\\/2019\\\/01\\\/25\\\/how-to-set-up-cascading-combo-boxes-on-an-excel-vba-userform\\\/\",\"url\":\"https:\\\/\\\/vbastring.com\\\/blog\\\/2019\\\/01\\\/25\\\/how-to-set-up-cascading-combo-boxes-on-an-excel-vba-userform\\\/\",\"name\":\"How To Set Up Cascading Combo Boxes On An Excel VBA Userform - My Blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/vbastring.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/vbastring.com\\\/blog\\\/2019\\\/01\\\/25\\\/how-to-set-up-cascading-combo-boxes-on-an-excel-vba-userform\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/vbastring.com\\\/blog\\\/2019\\\/01\\\/25\\\/how-to-set-up-cascading-combo-boxes-on-an-excel-vba-userform\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/www.vbastring.com\\\/blog\\\/wp-content\\\/uploads\\\/2019\\\/01\\\/cascading_combo_boxes_excel_vba_userform.png\",\"datePublished\":\"2019-01-25T04:56:54+00:00\",\"dateModified\":\"2019-01-29T04:11:18+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/vbastring.com\\\/blog\\\/#\\\/schema\\\/person\\\/e1de0b30e98940381697872449c341f5\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/vbastring.com\\\/blog\\\/2019\\\/01\\\/25\\\/how-to-set-up-cascading-combo-boxes-on-an-excel-vba-userform\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/vbastring.com\\\/blog\\\/2019\\\/01\\\/25\\\/how-to-set-up-cascading-combo-boxes-on-an-excel-vba-userform\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/vbastring.com\\\/blog\\\/2019\\\/01\\\/25\\\/how-to-set-up-cascading-combo-boxes-on-an-excel-vba-userform\\\/#primaryimage\",\"url\":\"http:\\\/\\\/www.vbastring.com\\\/blog\\\/wp-content\\\/uploads\\\/2019\\\/01\\\/cascading_combo_boxes_excel_vba_userform.png\",\"contentUrl\":\"http:\\\/\\\/www.vbastring.com\\\/blog\\\/wp-content\\\/uploads\\\/2019\\\/01\\\/cascading_combo_boxes_excel_vba_userform.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/vbastring.com\\\/blog\\\/2019\\\/01\\\/25\\\/how-to-set-up-cascading-combo-boxes-on-an-excel-vba-userform\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/vbastring.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How To Set Up Cascading Combo Boxes On An Excel VBA 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":"How To Set Up Cascading Combo Boxes On An Excel VBA 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\/2019\/01\/25\/how-to-set-up-cascading-combo-boxes-on-an-excel-vba-userform\/","og_locale":"en_US","og_type":"article","og_title":"How To Set Up Cascading Combo Boxes On An Excel VBA Userform - My Blog","og_description":"Hi everyone, in the previous post How To Make A Basic Excel VBA UserForm Search Box I showed how to create a search form based on three columns, but the issue with it was that it shows all the items in the column, and doesn&#8217;t filter the data based on the previous selection. In this [&hellip;]","og_url":"https:\/\/vbastring.com\/blog\/2019\/01\/25\/how-to-set-up-cascading-combo-boxes-on-an-excel-vba-userform\/","og_site_name":"My Blog","article_published_time":"2019-01-25T04:56:54+00:00","article_modified_time":"2019-01-29T04:11:18+00:00","og_image":[{"url":"http:\/\/www.vbastring.com\/blog\/wp-content\/uploads\/2019\/01\/cascading_combo_boxes_excel_vba_userform.png","type":"","width":"","height":""}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"Written by":"admin","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/vbastring.com\/blog\/2019\/01\/25\/how-to-set-up-cascading-combo-boxes-on-an-excel-vba-userform\/#article","isPartOf":{"@id":"https:\/\/vbastring.com\/blog\/2019\/01\/25\/how-to-set-up-cascading-combo-boxes-on-an-excel-vba-userform\/"},"author":{"name":"admin","@id":"https:\/\/vbastring.com\/blog\/#\/schema\/person\/e1de0b30e98940381697872449c341f5"},"headline":"How To Set Up Cascading Combo Boxes On An Excel VBA Userform","datePublished":"2019-01-25T04:56:54+00:00","dateModified":"2019-01-29T04:11:18+00:00","mainEntityOfPage":{"@id":"https:\/\/vbastring.com\/blog\/2019\/01\/25\/how-to-set-up-cascading-combo-boxes-on-an-excel-vba-userform\/"},"wordCount":269,"image":{"@id":"https:\/\/vbastring.com\/blog\/2019\/01\/25\/how-to-set-up-cascading-combo-boxes-on-an-excel-vba-userform\/#primaryimage"},"thumbnailUrl":"http:\/\/www.vbastring.com\/blog\/wp-content\/uploads\/2019\/01\/cascading_combo_boxes_excel_vba_userform.png","inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/vbastring.com\/blog\/2019\/01\/25\/how-to-set-up-cascading-combo-boxes-on-an-excel-vba-userform\/","url":"https:\/\/vbastring.com\/blog\/2019\/01\/25\/how-to-set-up-cascading-combo-boxes-on-an-excel-vba-userform\/","name":"How To Set Up Cascading Combo Boxes On An Excel VBA Userform - My Blog","isPartOf":{"@id":"https:\/\/vbastring.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/vbastring.com\/blog\/2019\/01\/25\/how-to-set-up-cascading-combo-boxes-on-an-excel-vba-userform\/#primaryimage"},"image":{"@id":"https:\/\/vbastring.com\/blog\/2019\/01\/25\/how-to-set-up-cascading-combo-boxes-on-an-excel-vba-userform\/#primaryimage"},"thumbnailUrl":"http:\/\/www.vbastring.com\/blog\/wp-content\/uploads\/2019\/01\/cascading_combo_boxes_excel_vba_userform.png","datePublished":"2019-01-25T04:56:54+00:00","dateModified":"2019-01-29T04:11:18+00:00","author":{"@id":"https:\/\/vbastring.com\/blog\/#\/schema\/person\/e1de0b30e98940381697872449c341f5"},"breadcrumb":{"@id":"https:\/\/vbastring.com\/blog\/2019\/01\/25\/how-to-set-up-cascading-combo-boxes-on-an-excel-vba-userform\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/vbastring.com\/blog\/2019\/01\/25\/how-to-set-up-cascading-combo-boxes-on-an-excel-vba-userform\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/vbastring.com\/blog\/2019\/01\/25\/how-to-set-up-cascading-combo-boxes-on-an-excel-vba-userform\/#primaryimage","url":"http:\/\/www.vbastring.com\/blog\/wp-content\/uploads\/2019\/01\/cascading_combo_boxes_excel_vba_userform.png","contentUrl":"http:\/\/www.vbastring.com\/blog\/wp-content\/uploads\/2019\/01\/cascading_combo_boxes_excel_vba_userform.png"},{"@type":"BreadcrumbList","@id":"https:\/\/vbastring.com\/blog\/2019\/01\/25\/how-to-set-up-cascading-combo-boxes-on-an-excel-vba-userform\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/vbastring.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How To Set Up Cascading Combo Boxes On An Excel VBA 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\/404","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=404"}],"version-history":[{"count":5,"href":"https:\/\/vbastring.com\/blog\/wp-json\/wp\/v2\/posts\/404\/revisions"}],"predecessor-version":[{"id":428,"href":"https:\/\/vbastring.com\/blog\/wp-json\/wp\/v2\/posts\/404\/revisions\/428"}],"wp:attachment":[{"href":"https:\/\/vbastring.com\/blog\/wp-json\/wp\/v2\/media?parent=404"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/vbastring.com\/blog\/wp-json\/wp\/v2\/categories?post=404"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/vbastring.com\/blog\/wp-json\/wp\/v2\/tags?post=404"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}