Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Delete Rows where all cells = 0
Hi SL
Try this one for row 1 :655 0n the activesheet Sub Example2() Dim Lrow As Long Dim CalcMode As Long Dim StartRow As Long Dim EndRow As Long With Application CalcMode = .Calculation .Calculation = xlCalculationManual .ScreenUpdating = False End With With ActiveSheet .DisplayPageBreaks = False StartRow = 1 EndRow = 655 For Lrow = EndRow To StartRow Step -1 If Application.WorksheetFunction.CountIf(Range(.Cells (Lrow, "A"), _ .Cells(Lrow, "DL")), "0") = 116 Then .Rows(Lrow).Delete Next End With With Application .ScreenUpdating = True .Calculation = CalcMode End With End Sub -- Regards Ron de Bruin http://www.rondebruin.nl "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 throughout the data | Excel Worksheet Functions | |||
delete rows with empty cells | Excel Discussion (Misc queries) | |||
Delete rows with empty cells in columns B&C | Excel Discussion (Misc queries) |