ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   MACRO TO DELETE ROW IF CELL VALUE IS ZERO (https://www.excelbanter.com/excel-programming/409465-macro-delete-row-if-cell-value-zero.html)

K[_2_]

MACRO TO DELETE ROW IF CELL VALUE IS ZERO
 
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"

Office_Novice

MACRO TO DELETE ROW IF CELL VALUE IS ZERO
 
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

"K" wrote:

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"



All times are GMT +1. The time now is 12:30 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com