I have a ListBox with Multiselected Items (with checkBox), and I have to do Autofilter in My sheet: Table, to find matching rows. perhaps, there is another idea to do this?
I've done this, but it doesn't run: error at the end about: .Columns(Columns.Count).AutoFilter field:=1, Criteria1:="F"
HELP!!!!
Code: Select all
Dim i As Long, LastLig As Long
Application.ScreenUpdating = False
With Sheets("Table")
LastLig = .Cells(Rows.Count, "B").End(xlUp).Row
.Columns(Columns.Count).Delete
For i = 0 To ListBox1.ListCount - 1
If ListBox1.Selected(i) Then
.Range("B1:B" & LastLig).AutoFilter field:=1, Criteria1:="=" & CDbl(Me.ListBox1.List(i))
.Range(.Cells(2, Columns.Count), .Cells(LastLig, Columns.Count)).SpecialCells(xlCellTypeVisible).Value = "F"
End If
Next i
.Range("B1").AutoFilter
.Columns(Columns.Count).AutoFilter field:=1, Criteria1:="F"
End With