Cascading Combo Box & Content Filtering

J

Joe Jacobs

I have a multi-sheet workbook in which I would like to autofill key cells.
Sheet 1 contains spec records that can be tagged for complexity: high,
medium, low. Sheet 2 contains the autofill cells.

My problem: I wish to use two combo boxes to filter the spec records by tag.
Combo Box 1 allows the user to select the appropriate complexity level.
Based on this selection, Combo Box 2 should populate with the filtered
records. Selecting a record in Combo Box 2, finally, should populate the
autofill cells with the appropriate information.

I attempted to use Tom Oglivy's code on "Filtered list for Combo Box
ListFillRange" response to populate Combo Box 2. It is not working and, as a
VBA newbie, I need additional assistance.
 
J

Joe Jacobs

I am including the code I have at present (below). I am having trouble with
the AddItem property. It appears that I cannot add an item from another
defined range. Any help would be appreciated.

Private Sub ComboBox1_Click()

Dim cRange As Range
Set cRange = Me.Range("RNG1")
Dim sRange As Range
Set sRange = Me.Range("LS1")
Dim x As Integer 'For Row
x = 10

Me.ComboBox2.Clear

For Each sRange In Range(cRange).Columns(1).Cells
If cRange.Value = Me.ComboBox1.Value Then
For x = 10 To 19
ComboBox2.AddItem sRange.Cells(x, 34)
ComboBox2.List(ComboBox2.ListCount - 1, 1) = cRange.Offset(0, 1)
Next x
End If
Next
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top