View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
sverre sverre is offline
external usenet poster
 
Posts: 78
Default Delete rows that are visible after applying filter

Ok, works!

What I dont understand is the following part of the code:

With ActiveSheet.AutoFilter.Range
On Error Resume Next
Set rng = .Offset(1, 0).Resize(.Rows.Count - 1, 1) _
.SpecialCells(xlCellTypeVisible)
On Error GoTo 0
If Not rng Is Nothing Then rng.EntireRow.delete

Does it tell Excel to move down in the visible area to check wheter the row
is nonempty and if that is the case-delete the row?

Many thanks
Sverker

"Ron de Bruin" skrev:

See
http://www.rondebruin.nl/delete.htm

Try
http://www.rondebruin.nl/delete.htm#AutoFilter


--
Regards Ron de Bruin
http://www.rondebruin.nl



"sverre" wrote in message ...
Hi

I have the following code:

Selection.AutoFilter Field:=4, Criteria1:="=*ÖVROBL*", Operator:=xlAnd

Now I would like to delete rows that are visible except the first which
contains
the headlines.

How do I write that?
Br
Sverre