Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
In addition to this excellent idea, if you wish not to copy the Heading Row,
just offset by 1. Sub Demo() Dim rngTo As Range Set rngTo = Sheets(2).Range("A1") ActiveSheet.AutoFilter.Range. _ Offset(1).Copy rngTo End Sub -- HTH :) Dana DeLouis Windows XP & Office 2003 "N10" wrote in message ... Hi Try this With code select the filtered range then use Selection.SpecialCell(xlCellTypeVisible).Select Selection.Copy This copies only the cells visble as a result of the filter criteria N10 ;) "Astongizmo" wrote in message ... Hi - I'm new to macros and the answer to my question is probably already posted. I have a spreadsheet containing an autofilter. This always returns the same number of columns but the number of rows can vary. I want to copy the displayed rows only to a second sheet building up a list on the second sheet, so each time I select a new filter the result will be copied to the second sheet below any data already there. As a second stage I want to sort the second sheet and extract all rows where a certain column matches a fixed criteria into a further sheet. This second stage will require to be done twice as the criteria changes. Any help will be gratefully received. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Dana,
Please see my response to N10 - really appreciate your input. I am a virgin code user so does your section go before or after the code suggested by N10? Thanks once again. "Dana DeLouis" wrote: In addition to this excellent idea, if you wish not to copy the Heading Row, just offset by 1. Sub Demo() Dim rngTo As Range Set rngTo = Sheets(2).Range("A1") ActiveSheet.AutoFilter.Range. _ Offset(1).Copy rngTo End Sub -- HTH :) Dana DeLouis Windows XP & Office 2003 "N10" wrote in message ... Hi Try this With code select the filtered range then use Selection.SpecialCell(xlCellTypeVisible).Select Selection.Copy This copies only the cells visble as a result of the filter criteria N10 ;) "Astongizmo" wrote in message ... Hi - I'm new to macros and the answer to my question is probably already posted. I have a spreadsheet containing an autofilter. This always returns the same number of columns but the number of rows can vary. I want to copy the displayed rows only to a second sheet building up a list on the second sheet, so each time I select a new filter the result will be copied to the second sheet below any data already there. As a second stage I want to sort the second sheet and extract all rows where a certain column matches a fixed criteria into a further sheet. This second stage will require to be done twice as the criteria changes. Any help will be gratefully received. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
macro to autofilter other file and copy in opened file | Excel Programming | |||
Questions: Copy ranges, autofilter macro, subtotals, & naming shee | Excel Programming | |||
Autofilter copy | Excel Programming | |||
Copy Autofilter results macro | Excel Programming | |||
AutoFilter and copy | Excel Programming |