Copy from a Filtered List in aanother worksheet

F

Frederick

I am afraid I am back again with another request but I know I am in good
hands.

This time what I am looking for is a snip of VBA Code to allow me (in a code
module) to set up either a filter or use the autofilter in a second workbook
then apply a filter using the Combo Box type arrows. Lets say it is
filtering "Yes" I would then like to copy the selection and paste back into
my original workbook. The Range to be Selected can be any size and will
sometimes grow or shrink. I am actually trying to build myself a Wizard and
this is one of the steps I need to cover.

If I apply this filter manually using the autofilter method I notice that
the first row in the filtered selection is 'say' Row 21, how do I set up the
copy to know it should start at Row 21 and Select only the Rows which have
been filtered bearing in mind these become quite Random. Is there an in
built VBA Method / Property I can use to do this with.


Regards Fred
 
T

Tom Ogilvy

When you copy a filtered range, only the visible cells are copied. (xl97 and
later at least)

Turn on the macro recorder and do what you want manually. then turn it off
and you will have the basic code you need.

Regards,
Tom Ogilvy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top