> two filter conditions

  • Thread starter Thread starter Jen
  • Start date Start date
J

Jen

complete newbie to macros and vb, so bear with me I'm
trying to learn :-)

my problem;

say you have a list of say 50 names all with associated
rows of data, how do you write a macro to -
look down the "name field" to see if any of say 10
specific names are present and if they are, to filter
these rows out and place in another worksheet?

added problem (1)- these names may or may not appear in
the "name field" in different worksheets AND they will not
always appear in the same place in the list

added problem (2)- the spreadsheets contain hidden columns
and i only want to select visible columns (having tried a
cut and paste macro i have had problems with hidden header
fields becoming visible and the fact the cell position
changes between worksheets)

The advanced filter will only let me select two "names" to
filter out and although i have tried to add extra names
using xlOR commands, I'm obviously not getting anywhere!

Advice much appreciated...

Thanks in advance,
Jen
 
The advanced filter doesn't limit you to two names -- you could create a
criteria range with as many names as you need to filter.

On the destination sheet, add the headings for the columns that you want
to include. If a column heading is omitted, the data from that column
won't be extracted by the filter.

Start the advanced filter from the destination worksheet, and select a
cell that is not adjacent to the cells with the headings.
 
Back
Top