Delete a filtered set

  • Thread starter Thread starter cmac
  • Start date Start date
C

cmac

Hello,

As a part of a macro I would like to turn auto filters on and then find rows
of data that contain a zero in the 4th field. I would then like to delete
the rows contained in the results - however, the range may be different each
time the macro is run. is there a way to delete the results in general - can
you help?
 
Try this in Column A:

Sub FilterZeros()
Columns("A:A").AutoFilter
Range("A:A").AutoFilter Field:=1, Criteria1:="=0", Operator:=xlAnd
Range("A:A").SpecialCells(xlCellTypeVisible).EntireRow.Delete Shift:=xlUp

End SUb
 
Back
Top