Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Allow Delete cells but not rows Elton Law[_2_] Excel Worksheet Functions 1 April 30th 09 10:53 AM
How do I delete rows where cells are empty Stan Excel Discussion (Misc queries) 2 January 2nd 08 05:49 AM
delete rows with empty cells throughout the data rutski Excel Worksheet Functions 4 November 16th 07 04:24 PM
delete rows with empty cells Slohcin Excel Discussion (Misc queries) 14 December 19th 06 05:14 PM
Delete rows with empty cells in columns B&C Richard Excel Discussion (Misc queries) 3 March 18th 06 12:15 AM


All times are GMT +1. The time now is 08:31 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"