Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Deleting rows filled with 0

In Excel 2002 I have a sheet with data table from A1:E9.

The actual starts at B2 and ends at E9. If B:E of the same
row has zero I would like to delete that row. Thus if
cells in the range B3:E3 and cells in the range B8:E8 have
zeros then those rows should be deleted.

Thanks.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 473
Default Deleting rows filled with 0

Perry Kew wrote:
The actual starts at B2 and ends at E9. If B:E of the same
row has zero I would like to delete that row. Thus if
cells in the range B3:E3 and cells in the range B8:E8 have
zeros then those rows should be deleted.

With Range("A1:E9")
.AutoFilter
.AutoFilter 2,0
.AutoFilter 3,0
.AutoFilter 4,0
.AutoFilter 5,0
If .Columns(1).SpecialCells(xlVisible).Count1 Then
.Offset(1).Resize(.Rows.Count-1).SpecialCells(xlVisible).Delete _
Shift:=xlUp
End If
.AutoFilter
End With

Bill Manville
MVP - Microsoft Excel, Oxford, England
No email replies please - reply in newsgroup

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Deleting rows filled with 0

Thank you very much for your help Bill. This is what I
wanted and it has helped me out a lot.

-----Original Message-----
Perry Kew wrote:
The actual starts at B2 and ends at E9. If B:E of the

same
row has zero I would like to delete that row. Thus if
cells in the range B3:E3 and cells in the range B8:E8

have
zeros then those rows should be deleted.

With Range("A1:E9")
.AutoFilter
.AutoFilter 2,0
.AutoFilter 3,0
.AutoFilter 4,0
.AutoFilter 5,0
If .Columns(1).SpecialCells(xlVisible).Count1 Then
.Offset(1).Resize(.Rows.Count-1).SpecialCells

(xlVisible).Delete _
Shift:=xlUp
End If
.AutoFilter
End With

Bill Manville
MVP - Microsoft Excel, Oxford, England
No email replies please - reply in newsgroup

.

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
Count filled data rows until empty Dallman Ross Excel Discussion (Misc queries) 7 May 9th 23 11:43 AM
Hundreds of Blank rowas below my content-filled rows Laura Excel Discussion (Misc queries) 2 January 8th 10 04:07 PM
Hpw do I delete multiple empty rows found between filled rows? Bill Excel Worksheet Functions 2 November 15th 09 07:12 PM
Print data filled rows only Cricket Excel Worksheet Functions 2 June 22nd 08 05:54 AM
finding the no. of rows in a COL filled with numbers, zeros and bl z.entropic Excel Worksheet Functions 14 May 21st 05 11:05 PM


All times are GMT +1. The time now is 08:11 AM.

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"