Hi,
I was wondering if there was a simpler way to delete rows based on multiple autofilter criteria.
My code now is as follows (I have individual lines for each criteria).
Is it possible to lump all criteria together, or to have it search within a range?
I was wondering if there was a simpler way to delete rows based on multiple autofilter criteria.
My code now is as follows (I have individual lines for each criteria).
Is it possible to lump all criteria together, or to have it search within a range?
Code:
With ActiveSheet
If .AutoFilterMode = False Then .Cells(1, 1).AutoFilter
.Range("A1").AutoFilter Field:=1, Criteria1:="15564"
.Range("A1").CurrentRegion.Offset(1, 0).SpecialCells(xlCellTypeVisible).EntireRow.Delete
.Range("A1").AutoFilter Field:=1, Criteria1:="10805"
.Range("A1").CurrentRegion.Offset(1, 0).SpecialCells(xlCellTypeVisible).EntireRow.Delete
.Range("A1").AutoFilter Field:=1, Criteria1:="16338"
.Range("A1").CurrentRegion.Offset(1, 0).SpecialCells(xlCellTypeVisible).EntireRow.Delete
.Range("A1").AutoFilter Field:=1, Criteria1:="14982"
.Range("A1").CurrentRegion.Offset(1, 0).SpecialCells(xlCellTypeVisible).EntireRow.Delete
.Range("A1").AutoFilter Field:=1, Criteria1:="16391"
.Range("A1").CurrentRegion.Offset(1, 0).SpecialCells(xlCellTypeVisible).EntireRow.Delete
.Range("A1").AutoFilter Field:=1, Criteria1:="14928"
.Range("A1").CurrentRegion.Offset(1, 0).SpecialCells(xlCellTypeVisible).EntireRow.Delete
.Range("A1").AutoFilter Field:=1, Criteria1:="15563"
.Range("A1").CurrentRegion.Offset(1, 0).SpecialCells(xlCellTypeVisible).EntireRow.Delete
.AutoFilterMode = False
End With