Private Sub CommandButton1_Click()
Dim i As Integer
Dim j As Integer
ListBox1.RowSource = ""
j = 0
For i = 2 To Range("B65536").End(xlUp).Row
If ComboBox1.Text = Cells(i, 2) Then
With ListBox1
.AddItem
.list(j, 0) = Cells(i, 1)
.list(j, 1) = Cells(i, 2)
.list(j, 2) = Cells(i, 3)
.list(j, 3) = Cells(i, 4)
End With
j = j + 1
End If
Next i
End Sub
Private Sub CommandButton2_Click()
Dim i As Integer
Dim j As Integer
ListBox1.RowSource = ""
j = 0
For i = 2 To Range("C65536").End(xlUp).Row
If ComboBox2.Text = Cells(i, 3) Then
With ListBox1
.AddItem
.list(j, 0) = Cells(i, 1)
.list(j, 1) = Cells(i, 2)
.list(j, 2) = Cells(i, 3)
.list(j, 3) = Cells(i, 4)
End With
j = j + 1
End If
Next i
End Sub
conceptually i found this the easiest way to do it
which is basically clear listbox and manually add every line back in that matches criteria via a loop
the alternative way to do it is to "create" the list somewhere and use that list as rowsource
this alternative method would be if you had another use of subset data you created with your filter
should probably put something in there to reset to original form/list but you should be able to do that if you have come this far
Bookmarks