Advance Filter

F

fi.or.jp.de

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"....???
 
D

Don Guillett

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"....???
???
<>
 
F

fi.or.jp.de



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.
 
G

GS

It happens that fi.or.jp.de formulated :
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"
 
F

fi.or.jp.de

It happens that fi.or.jp.de formulated :













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"
 

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