MACRO TO DELETE ROW IF CELL VALUE IS ZERO

K

K

I need macro which should go through in column "E2:E" of sheet
("DATA") and if finds any cell value = 0 then it should delete that
entire row. Note that I have heading in cell "E1"
 
O

Office_Novice

Somthing Like


Sub DeleteZero()

Worksheets("Data").Activate
Range("E2").Select

Do
If ActiveCell.Value = "0" Then
ActiveCell.EntireRow.Delete Shift:=xlShiftUp
ElseIf ActiveCell.Value <> "0" Then
ActiveCell.Offset(1, 0).Select
End If
Loop
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