Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 227
Default 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
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 Slohcin Excel Discussion (Misc queries) 14 December 19th 06 05:14 PM
Delete Rows where cells does not meet criteria Danny Excel Worksheet Functions 1 September 12th 05 05:08 PM
Delete Rows where all cells = 0 Ron de Bruin Excel Programming 0 August 11th 04 04:23 PM


All times are GMT +1. The time now is 11:12 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"