Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Excel VBA AdvancedFilter Question

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?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 320
Default Excel VBA AdvancedFilter Question

Have A3 be exactly this:
="=pot"


"Elliott" wrote:

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?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Excel VBA AdvancedFilter Question

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

"Bob Umlas, Excel MVP" wrote:

Have A3 be exactly this:
="=pot"


"Elliott" wrote:

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?

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
AdvancedFilter dannibrook Excel Programming 4 April 25th 06 11:19 AM
Advancedfilter ram Excel Programming 1 December 30th 05 02:18 AM
Advancedfilter doesn't work when Excel opens, but does when run macro Josh[_13_] Excel Programming 0 December 8th 05 09:52 PM
AdvancedFilter Criteria question Neal Steiner Excel Programming 2 September 10th 03 06:53 PM
AdvancedFilter question Debra Dalgleish[_2_] Excel Programming 0 September 1st 03 12:14 AM


All times are GMT +1. The time now is 02:21 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"