Populate Make/Model Combobox

shibbyz

New Member
Joined
Dec 29, 2013
Messages
6
Good Evening,

I have two comboboxes that I am trying to populate from an excel sheet and I could use some help getting the second one to work.

The first box is a "Make" box where the user selects the make of, say - a car. From there, it populates the second "Model" box based on the models that that Maker provides.

I have this set up in an excel sheet where each column is dedicated to the Make - so, the first row is all Manufacturers (For cars, Ford, Chevy, Dodge, Buick, etc). Below each manufacturer, I have all of the cars they make listed. My goal is that when a user selects the Make, the Model box automatically populates with the content in the column below the manufacturer name.

I have successfully made the Make box autopopulate on the "Inititialize" command but I am having trouble getting the model box to populate when the make is selected. My code is below.

Private Sub Userform_Initialize()
'Populates Make List
column_review = 0

Dim Model As Worksheet
Set Model = Sheets("MakeModel")

Do
DoEvents
column_review = column_review + 1
item_in_review = Model.Cells(1, column_review)

If Len(item_in_review) > 0 Then cboMake.AddItem (item_in_review)

Loop Until item_in_review = ""

End Sub

This code works^ to populate the make box. Below is my poor attempt at getting the model box to populate. I know I need to get column_review to equal the column of the make.

Private Sub cboMake_Change()

''Populates Model list based on "Make" Selection
make_review = 1

' Dim Makeselect As String
Set Makeselect = cboMake.Text


' Dim Make As Worksheet
' Set Make = Sheets("MakeModel")

Do
DoEvents
make_review = make_review + 1
item_in_review = Model.Cells(1, column_review)

If Len(item_in_review) > 0 Then cboMake.AddItem (item_in_review)

Loop Until item_in_review = ""

End Sub

Any help is appreciated. Thanks!
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).

Forum statistics

Threads
1,216,474
Messages
6,130,841
Members
449,598
Latest member
sunny_ksy

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top