View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
ben ben is offline
external usenet poster
 
Posts: 232
Default Delete rows with different criteria

play with your criteria a little until you have only the rows showing you
want to delete
then
activesheet.rows("11:2000").delete

--
When you lose your mind, you free your life.


"STEVE BELL" wrote:

You can use something like this to select visible cells
and than copy them to another location

Selection.SpecialCells(xlCellTypeVisible).Select

or something like this

Dim rw As Long, lrw As Long
lrw = Cells(Rows.Count, "A").End(xlUp).Row

For rw = lrw To 1 Step -1
If Rows(re).Hidden = True Then
MsgBox Rows(x).Address
End If
Next


--
steveB

Remove "AYN" from email to respond
"John" wrote in message
...
I have a simple macro that filters (hides) the data that is unapplicable in
each worksheet. How would I make the macro delete the rows that it is
hiding
in the autofilter? My code is below.

THANKS!

Selection.AutoFilter Field:=8, Criteria1:="<", Operator:=xlAnd
Selection.AutoFilter Field:=14, Criteria1:="0", Operator:=xlAnd
Selection.AutoFilter Field:=18, Criteria1:="=7.00", Operator:=xlAnd
Sheets("AG Non Call").Select
Selection.AutoFilter Field:=8, Criteria1:="=#N/A N Ap", Operator:=xlAnd
Selection.AutoFilter Field:=14, Criteria1:="0", Operator:=xlAnd
Selection.AutoFilter Field:=18, Criteria1:="=7.00", Operator:=xlAnd
Sheets("CORPS").Select
Selection.AutoFilter Field:=14, Criteria1:="0", Operator:=xlAnd
Selection.AutoFilter Field:=18, Criteria1:="=8.00"