Linked Combo Boxes-dataTable lookup

03856me

Active Member
Joined
Apr 4, 2008
Messages
297
I have pieced together the following code to link my second combo box based on the value of the first combo box. I have a couple of issues that I could use your help with to make this more functional. Once this code is working then I will apply it to about 6 other combo boxes.

Specifics: I have a "lookupTable" on the "Lookups" tab that contains many columns of data starting in column 13.

Issue#1 - my code duplicates the values in column 14 when filtering it.

Issue#2 - this is a table, is there a way to use the table[column] names instead of 1000 rows, that way when the table grows all is well?

I am open to another way to doing this - most efficient is what I am looking for.

Code:
Private Sub cbo_group_change()
    Dim I As Long
    Dim ws As Worksheet 
        Set ws = Worksheets("Lookups")
        cbo_kiln.Clear
 
      [COLOR=seagreen]  'I would like to use the table column name here instead of 1000 rows[/COLOR]
        For I = 13 To ws.Cells(1000, 13).End(xlUp).Row
            If ws.Cells(I, 13) = cbo_group.Value Then
                cbo_kiln.AddItem ws.Cells(I, 14)
            End If
        Next I
End Sub
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.

Forum statistics

Threads
1,223,270
Messages
6,171,102
Members
452,379
Latest member
IainTru

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