Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Delete Rows where all cells = 0
Hi SL
Sub test() Application.ScreenUpdating=False Dim r As Range, rr As Range, c As Range Set r = Range("A1:A655") For Each c In r If Application.CountIf(Range(c, c.Offset(0, 115)), 0) = 116 Then If rr Is Nothing Then Set rr = c Else Set rr = Union(rr, c) End If End If Next c If Not rr Is Nothing Then rr.EntireRow.Delete Application.ScreenUpdating=True End Sub -- XL2002 Regards William "SL" wrote in message ... | Hello | | I have a large worksheet - 655 rows & 116 columns. I need to be able to | search each cell on each row & if all the cells are 0 then delete the row. | Otherwise, leave the row on the worksheet. | | I need to be able to do this within a macro. | | Can anyone help?? | | Thank You | | Sonya |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Allow Delete cells but not rows | Excel Worksheet Functions | |||
How do I delete rows where cells are empty | Excel Discussion (Misc queries) | |||
delete rows with empty cells | Excel Discussion (Misc queries) | |||
Delete Rows where cells does not meet criteria | Excel Worksheet Functions | |||
Delete Rows where all cells = 0 | Excel Programming |