Linked Combo Boxes-dataTable lookup

03856me

Active Member
Joined
Apr 4, 2008
Messages
261
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
 

Some videos you may like

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.

Watch MrExcel Video

Forum statistics

Threads
1,099,699
Messages
5,470,274
Members
406,686
Latest member
BNR_ 1980

This Week's Hot Topics

Top