Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I have two multi-select listboxes. The selections from ListBox 1 will determine the and filter the available choices for Listbox 2. I do have code that works when a combobox is used as the source to filter a listbox. But I am not sure how I can modify it to accommodate a multi-select listbox as the source. Thanks for your help! My code is below which works when a single select combo box is used as the source: Private Sub cboxProductLine_Change() Dim myRng As Range Dim myCell As Range If Me.cboxProductLine.ListIndex < 0 Then Me.lstProductFiltered.ListIndex = -1 End If With Worksheets("LOVs") Set myRng = .Range("ProductFilter") 'Using a dynamic named range End With 'Clear list index if it already exists. With lstProductFiltered .Clear End With For Each myCell In myRng.Cells If LCase(myCell.Value) = LCase(Me.cboxProductLine.Value) Then Me.lstProductFiltered.AddItem myCell.Offset(0, 1).Value End If Next myCell End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to I filter one list based on another list? | Excel Discussion (Misc queries) | |||
Formula (not adv. filter) to list unique values from list | Excel Worksheet Functions | |||
How to filter list from pre-existing list | Excel Discussion (Misc queries) | |||
Filter the results of a list based on a previous vlookup against the same list | Excel Worksheet Functions | |||
How to filter a 2nd list based on selection in 1st list. | Excel Programming |