View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Ron de Bruin Ron de Bruin is offline
external usenet poster
 
Posts: 11,123
Default Delete Filtered Rows - without deleting column headings

Hi Denise

See how Tom use rng2 in this example to copy
http://www.contextures.com/xlautofilter03.html#Copy
You can adapt the code to delete

My new Addin can do this also
http://www.rondebruin.nl/easyfilter.htm

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


"Denise" wrote in message ...
I have the following code that filters the rows that I
want to delete, however it also deletes the column
headings. How do I change it to preserve the headings?
Thanks in advance for your help.

' Find the rows that do not have a D or a Z in column C
' and delete them. Cells with D are orders rows, cells
' with Z are Sales Doc rows.
Columns("C:C").Select
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:="<Z*",
Operator:=xlAnd, _
Criteria2:="<D*"
Cells.SpecialCells(xlCellTypeVisible).EntireRow.De lete