How To Set Up Cascading Combo Boxes On An Excel VBA Userform

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’t filter the data based on the previous selection.

In this post I will show you how to limit your selection based on the previous selection.

For example, here you see a sorted list of unique years:

Here you’ll see the makes that belong to those years:

We are going to be using the ADO library which makes this very easy and straight forward.

With ADO we don’t have to write extra code for selecting only unique values and sorting the list items.
We’ll let ADO do the “heavy lifting” for us so we don’t have to write so much code.

I’ll compare the 2 ways of writing this in another post.

Before we were using the “LoadBoxes” procedure which was loading all the combo boxes without ADO.

When we initialize the UserForm we are loading all the comboboxes with unique values:

We’ll use the combo box’s “Change” event to get the pass the combo box’s value to load the correct values on the others.

First when the year changes:

Second when the make changes, we want to update the models:

So now when we search, we’ll always have a result!

Watch how it’s done:


Let me know if you have any questions.

Please remember to subscribe to my youtube channel

Been helped? Get these!

Facebooktwittergoogle_plusredditpinterestlinkedinmail