Delete a filtered set

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?
 
M

Michael

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top