Deleting Rows

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

For a Macro novice...

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

Thank you
 
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
 
Back
Top