Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,298
Default autofilter and vba problem - FIGURED IT OUT

well done! Just wait until you try using VBA to filter a column of dates ;)

"GeorgeAtkins" wrote:

Okay, I figured it out:

Selection.AutoFilter Field:=16, Criteria1:="<*001*", Operator:=xlAnd, _
Criteria2:="<*281*"

I used the "does not contain" operator, which does a pattern match. This
works just keen. Text-formatted numbers must confuse Excel. Heck, they
confuse people, too (at least, when working IN Excel!).

So, no replies needed. Hope this Q&A was helpful and on to the next big one.

George


"GeorgeAtkins" wrote:

Using Excel 2003.

I'm stuck! I have several autofilter macros that work just fine. However,
one is not working at all. Here are the details:

1. All cells in the target column are formatted as Text.
2. The column contains text-based numbers (e.g. 001, 013, 279, etc.). So,
001 is actually in the cell, not a 1 formatted with 00 in front.

I want to be able to filter out (exclude) rows containing specific numbers
(e.g. no rows with 001). I can do this autofilter interactively, just fine!
But when I repeat the procedure in vba, it acts as if I've chosen the Show
All command: Nothing is filtered!

Here is my macro:
Range("Database").AutoFilter Field:=16, Criteria1:="<281",
Operator:=xlAnd, Criteria2:="<001"

Am I missing the obvious here? Keep in mind that all of my other autofilter
macros work well; but this is the only one that is based on "not equal to".

George

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
Can't get to bottom right corner of window to resize? I figured it Michael NoNOTooMuch Excel Discussion (Misc queries) 1 April 14th 08 11:06 PM
Still haven't figured this one out mevetts Excel Discussion (Misc queries) 7 January 3rd 06 10:11 AM
HELP!!! Can't get forumla figured out! JTKrupa Excel Discussion (Misc queries) 8 October 13th 05 10:13 PM
I figured everything out except what "FALSE" does. Paul (ESI) Excel Discussion (Misc queries) 4 August 1st 05 06:41 PM
Has anybody figured this out yet? Kevin Excel Programming 0 August 27th 03 01:40 PM


All times are GMT +1. The time now is 04:35 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"