Deleting rows filled with 0

  • Thread starter Thread starter Perry Kew
  • Start date Start date
P

Perry Kew

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.
 
Perry said:
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).Count>1 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
 
Thank you very much for your help Bill. This is what I
wanted and it has helped me out a lot.
 
Back
Top