Deleting Rows

F

fak119

For a Macro novice...

Is there an easy macro that deletes rows when a particular cell has the
value 0 (zero)?

Thank you
 
D

Don Guillett

try
Sub deletezerorows()
Application.DisplayAlerts = False
On Error Resume Next
vlr = Cells(Rows.Count, "d").End(xlUp).Row
With Range(Cells(2, "D"), Cells(vlr, "D"))
.AutoFilter Field:=1, Criteria1:="0"
..SpecialCells(xlCellTypeVisible).Delete
.AutoFilter
End With
Application.DisplayAlerts = False
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