Excel VBA AdvancedFilter Question

E

Elliott

I'm trying to use the AdvancedFilter option to filter some data. For
selecting some search criteria and then filtering it's working fine. Here's
my code for that:

Sheets("PreFilter").Columns("A:B").AdvancedFilter Action:= _
xlFilterCopy, CriteriaRange:=Sheets("Criteria").Range("A2:A3"),
CopyToRange _
:=Columns("A:B"), Unique:=True

I'd like to search with some exceptions. Ie: I'd like to search for 'pot'
without 'potato' coming up. In the Auto-filter, I can do that by saying 'pot'
and excluding 'ato.' What is the equivalent for the Advanced Filter?
 
E

Elliott

OK, the situation's a bit more complicated:
I've got four entries:
"Nut-Shiny-Big"
"Nut-Shiny-Small"
"Nutplate-Big"
"Nut,Plate-Small"

I'd like to filter 'Nut' to get the first two, but not the last two. Putting
="=nut" will filter out all, since there are dashes and commas, if i'm
correct.
In the end, I'd like to filter them onto two pages, one for nuts and the
other for nutplates.

Thanks
 

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