ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Selecting Filter Data (https://www.excelbanter.com/excel-programming/418902-selecting-filter-data.html)

Crazyhorse

Selecting Filter Data
 
I have data on a tab from 2008 to 2006. We have to keep the data from 2007 to
2006 so I save the workbook first. I filter the data.

Selection.AutoFilter Field:=3, Criteria1:="<=12/31/2007", Operator:=xlAnd
Selection.Offset(1, 1).SpecialCells(xlCellTypeVisible).copy

Now I have all of the data from 12/31/2007 to the last year of data. But it
grabs the headers of the data. How do I just select the filtered data only so
I can delete it.

Thanks in advance



Ron de Bruin

Selecting Filter Data
 
See this example

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



--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Crazyhorse" wrote in message ...
I have data on a tab from 2008 to 2006. We have to keep the data from 2007 to
2006 so I save the workbook first. I filter the data.

Selection.AutoFilter Field:=3, Criteria1:="<=12/31/2007", Operator:=xlAnd
Selection.Offset(1, 1).SpecialCells(xlCellTypeVisible).copy

Now I have all of the data from 12/31/2007 to the last year of data. But it
grabs the headers of the data. How do I just select the filtered data only so
I can delete it.

Thanks in advance




All times are GMT +1. The time now is 09:57 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com