ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Delete row when zero in column b thru e (https://www.excelbanter.com/excel-programming/299749-delete-row-when-zero-column-b-thru-e.html)

Andy

Delete row when zero in column b thru e
 
Hi All

I am sorry for posting it twice
Can some one help me with macro or vba code to delete the row when column B,,C,D, and E all 4 have the value of 0
(It has to be 0 in all 4 column). Its very big sheet with thousands of rows. Please help
I dont want this code to look row 1 thru 6. Because first 6 rows has headings this Should start from row 7 and end at row till the data ends

Thank
And



Charles

Delete row when zero in column b thru e
 
Andy,

"0" on the same row, or diff. rows?

Charle

--
Message posted from http://www.ExcelForum.com


Norman Jones

Delete row when zero in column b thru e
 
See reply at your previous post

---
Regards,
Norman

"Andy" wrote in message
...
Hi All,

I am sorry for posting it twice.
Can some one help me with macro or vba code to delete the row when column

B,,C,D, and E all 4 have the value of 0.
(It has to be 0 in all 4 column). Its very big sheet with thousands of

rows. Please help
I dont want this code to look row 1 thru 6. Because first 6 rows has

headings this Should start from row 7 and end at row till the data ends.

Thanks
Andy





No Name

Delete row when zero in column b thru e
 
0 on the same row starting row 7th till unknown end row.

Thanks
Andy
-----Original Message-----
Andy,

"0" on the same row, or diff. rows?

Charles


---
Message posted from http://www.ExcelForum.com/

.


Charles

Delete row when zero in column b thru e
 
Andy,


Here is my version thouge not tested.


Sub del_0()
Application.ScreenUpdating = False
Dim i As Long
Dim rng As Range
Worksheets("sheet1").Activate
Set rng = Worksheets("Sheet1").Cells(1, 1).CurrentRegion
For i = 7 To rng.Rows.Count
If rng(i, 2).Value = 0 And rng(i, 3).Value = 0 And rng(i, 4).Valu
= 0 And rng(i, 5).Value = 0 Then
rng(i, 2).EntireRow.Delete
i = i - 1
End If
Next i
End Sub


Charle

--
Message posted from http://www.ExcelForum.com



All times are GMT +1. The time now is 10:36 AM.

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