PC Review


Reply
Thread Tools Rate Thread

Advance Filter

 
 
fi.or.jp.de
Guest
Posts: n/a
 
      25th Jun 2011
Hi All,

I have excel file. I am doing some filtering.

in Column A i have more than 1000 rows, with more than 100 unique
values.

I want to deselect some of the values, say 4 items. In excel i can do
it only two item with available option.

In VBA i got few codes which select the more than two item in the
filter.

here's my code

Dim Sht As Worksheet
Dim Crt(0 To 2) As String
Set Sht = ActiveSheet

Crt(0) = "A"
Crt(1) = "B"
Crt(2) = "C"

Sht.UsedRange.AutoFilter Field:=1, Criteria1:=Crt,
Operator:=xlFilterValues

The above code filters only "A", "B" & "C" values.....

My question : is there any option to deselect only "A", "B",
"C"....???
 
Reply With Quote
 
 
 
 
Don Guillett
Guest
Posts: n/a
 
      25th Jun 2011
On Jun 25, 5:15*am, "fi.or.jp.de" <fi.or.jp...@gmail.com> wrote:
> Hi All,
>
> I have excel file. I am doing some filtering.
>
> in Column A i have more than 1000 rows, with more than 100 unique
> values.
>
> I want to deselect some of the values, say 4 items. In excel i can do
> it only two item with available option.
>
> In VBA i got few codes which select the more than two item in the
> filter.
>
> here's my code
>
> Dim Sht As Worksheet
> Dim Crt(0 To 2) As String
> Set Sht = ActiveSheet
>
> Crt(0) = "A"
> Crt(1) = "B"
> Crt(2) = "C"
>
> Sht.UsedRange.AutoFilter Field:=1, Criteria1:=Crt,
> Operator:=xlFilterValues
>
> The above code filters only "A", "B" & "C" values.....
>
> My question : is there any option to deselect only "A", "B",
> "C"....???

???
<>
 
Reply With Quote
 
fi.or.jp.de
Guest
Posts: n/a
 
      25th Jun 2011
On Jun 25, 8:53*pm, Don Guillett <dguille...@gmail.com> wrote:
> On Jun 25, 5:15*am, "fi.or.jp.de" <fi.or.jp...@gmail.com> wrote:
>
>
>
>
>
>
>
> > Hi All,

>
> > I have excel file. I am doing some filtering.

>
> > in Column A i have more than 1000 rows, with more than 100 unique
> > values.

>
> > I want to deselect some of the values, say 4 items. In excel i can do
> > it only two item with available option.

>
> > In VBA i got few codes which select the more than two item in the
> > filter.

>
> > here's my code

>
> > Dim Sht As Worksheet
> > Dim Crt(0 To 2) As String
> > Set Sht = ActiveSheet

>
> > Crt(0) = "A"
> > Crt(1) = "B"
> > Crt(2) = "C"

>
> > Sht.UsedRange.AutoFilter Field:=1, Criteria1:=Crt,
> > Operator:=xlFilterValues

>
> > The above code filters only "A", "B" & "C" values.....

>
> > My question : is there any option to deselect only "A", "B",
> > "C"....???

>
> ???
> <>



Hi Don, I didn't get your answer

I know the possible ways, using helper column ( input formula
=if(or(a2="A",a2="b",a2="c"),"Deselect","select" )
OR
I can use the Advance Filter with Criteria.

But i am looking for why i am not able input use "<>" in my code to
get the desired result.


 
Reply With Quote
 
GS
Guest
Posts: n/a
 
      25th Jun 2011
It happens that fi.or.jp.de formulated :
> On Jun 25, 8:53*pm, Don Guillett <dguille...@gmail.com> wrote:
>> On Jun 25, 5:15*am, "fi.or.jp.de" <fi.or.jp...@gmail.com> wrote:
>>
>>
>>
>>
>>
>>
>>
>>> Hi All,

>>
>>> I have excel file. I am doing some filtering.
>>> in Column A i have more than 1000 rows, with more than 100 unique
>>> values.

>>
>>> I want to deselect some of the values, say 4 items. In excel i can do
>>> it only two item with available option.
>>> In VBA i got few codes which select the more than two item in the
>>> filter.

>>
>>> here's my code

>>
>>> Dim Sht As Worksheet
>>> Dim Crt(0 To 2) As String
>>> Set Sht = ActiveSheet

>>
>>> Crt(0) = "A"
>>> Crt(1) = "B"
>>> Crt(2) = "C"

>>
>>> Sht.UsedRange.AutoFilter Field:=1, Criteria1:=Crt,
>>> Operator:=xlFilterValues

>>
>>> The above code filters only "A", "B" & "C" values.....
>>> My question : is there any option to deselect only "A", "B",
>>> "C"....???

>>
>> ???
>> <>

>
>
> Hi Don, I didn't get your answer
>
> I know the possible ways, using helper column ( input formula
> =if(or(a2="A",a2="b",a2="c"),"Deselect","select" )
> OR
> I can use the Advance Filter with Criteria.
>
> But i am looking for why i am not able input use "<>" in my code to
> get the desired result.


I believe Don is suggesting to use the 'NOT' operator as follows...

Crt(0) = "<>A"
Crt(1) = "<>B"
Crt(2) = "<>C"

--
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc


 
Reply With Quote
 
fi.or.jp.de
Guest
Posts: n/a
 
      26th Jun 2011
On Jun 25, 11:21*pm, GS <g...@somewhere.net> wrote:
> It happens that fi.or.jp.de formulated :
>
>
>
>
>
>
>
>
>
> > On Jun 25, 8:53*pm, Don Guillett <dguille...@gmail.com> wrote:
> >> On Jun 25, 5:15*am, "fi.or.jp.de" <fi.or.jp...@gmail.com> wrote:

>
> >>> Hi All,

>
> >>> I have excel file. I am doing some filtering.
> >>> in Column A i have more than 1000 rows, with more than 100 unique
> >>> values.

>
> >>> I want to deselect some of the values, say 4 items. In excel i can do
> >>> it only two item with available option.
> >>> In VBA i got few codes which select the more than two item in the
> >>> filter.

>
> >>> here's my code

>
> >>> Dim Sht As Worksheet
> >>> Dim Crt(0 To 2) As String
> >>> Set Sht = ActiveSheet

>
> >>> Crt(0) = "A"
> >>> Crt(1) = "B"
> >>> Crt(2) = "C"

>
> >>> Sht.UsedRange.AutoFilter Field:=1, Criteria1:=Crt,
> >>> Operator:=xlFilterValues

>
> >>> The above code filters only "A", "B" & "C" values.....
> >>> My question : is there any option to deselect only "A", "B",
> >>> "C"....???

>
> >> ???
> >> <>

>
> > Hi Don, I didn't get your answer

>
> > I know the possible ways, using helper column ( input formula
> > =if(or(a2="A",a2="b",a2="c"),"Deselect","select" )
> > OR
> > I can use the Advance Filter with Criteria.

>
> > But i am looking for why i am not able input use "<>" in my code to
> > get the desired result.

>
> I believe Don is suggesting to use the 'NOT' operator as follows...
>
> * Crt(0) = "<>A"
> * Crt(1) = "<>B"
> * Crt(2) = "<>C"
>
> --
> Garry
>
> Free usenet access athttp://www.eternal-september.org
> ClassicVB Users Regroup! comp.lang.basic.visual.misc



This doesn't work, any idea..

Crt(0) = "<>A"
Crt(1) = "<>B"
Crt(2) = "<>C"
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
My Advance Filter Doesn't Filter Jon Lam Microsoft Excel Misc 5 31st Mar 2010 11:30 AM
Advance Filter JRey Microsoft Excel Misc 2 14th Nov 2008 07:01 PM
Advance filter search does not filter an exact match cfiiland Microsoft Excel Programming 1 10th Jun 2005 12:44 PM
about advance filter =?Utf-8?B?TWF4?= Microsoft Excel New Users 1 30th Dec 2004 04:59 AM
Advance Filter Kay Microsoft Excel Worksheet Functions 1 9th Apr 2004 08:11 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:17 AM.