Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Autofilter for multiple not equal values

Tags:

excel

vba

I am adding autofilter for excel table as follows.

With Sheets("Sheet1")
With .ListObjects("Summary").Range
    .AutoFilter Field:=1, Criteria1:=">400000", Operator:=xlOr, Criteria2:=Array("<>440400", "<>440600", "<>440300")
    .AutoFilter Field:=5, Criteria1:=">110", Operator:=xlAnd, Criteria1:="<105"
    .SpecialCells(xlCellTypeVisible).Copy
End With
End With

n the result I am geeting value greater than 400000 . But I am getting 440400,440600 and 440300 values also in the result. How Can I add both filters?

like image 230
udaya726 Avatar asked Nov 10 '22 01:11

udaya726


1 Answers

So far, as I know, it cannot be done.

My work around :

1) Highlight records that meet criteria, loop one by one

2) Then Filter by Higlight

Hope this help !

like image 100
Eric K. Avatar answered Nov 15 '22 07:11

Eric K.