View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
N10 N10 is offline
external usenet poster
 
Posts: 141
Default How do I copy an autofilter using a macro?

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.