Hi there,
I have a macro that searches the active worksheet and copies all full and partial matches to a listbox. After this is done, I'd Like to enable users to further filter the results - if a checkbox is selected, only rows in the listbox with "admitted" in column 5 should remain, while all other rows are removed from the listbox (but not from the sheet). I tried the following code, which is not working (it removes all rows from the listbox, not just those with "admitted" in column 5):
Thanks in Advance
I have a macro that searches the active worksheet and copies all full and partial matches to a listbox. After this is done, I'd Like to enable users to further filter the results - if a checkbox is selected, only rows in the listbox with "admitted" in column 5 should remain, while all other rows are removed from the listbox (but not from the sheet). I tried the following code, which is not working (it removes all rows from the listbox, not just those with "admitted" in column 5):
Code:
Private Sub FilterAdmitted()
Dim n As Integer
For n = Results.ListCount - 1 To 0 Step -1
If Not Results.List.column(5).value = "Admitted" Then
Results.RemoveItem n
End If
Next n
End Sub
Thanks in Advance