Friends,

I have a list box that is populated by the user from a combobox of options. Then a commandbutton is clicked and the listbox is supposed to act as a filter and hide all rows that do not contain the listbox items. I have code that sill highlight all of the code, but I can't return the highlighted item to exucute the rest of my code... What do I do?

Private Sub CommandButton1_Click()

Dim r As Long

Range("A6").Select


r = Range("A6", Range("A6").End(xlDown)).Cells.Count

For x = 0 To r

    For i = 0 To CSJList.ListCount - 1
        
        CSJList.Selected(i) = True
                
        If CSJList.Value <> ActiveCell.Offset(x, 0).Value Then
        
            ActiveCell.Offset(r, 0).EntireRow.Hidden = True
            
        Else
        
        End If
        
    Next i
    
Next x

End Sub
As I am running through the code line by line it show CSJList.Value = Null

Thanks in advance,

Mike