How to filter using the NOT Array?

sourabh_ajmera

New Member
Joined
Jul 17, 2014
Messages
36
Hello Everybody,

I am stuck at a code where I would like to use a NOT function on filters with array. I want to use the 'not' function to not filter these 5 values from a list of 500 values

Rich (BB code):
    Sheets("Instrument").Select
    ActiveSheet.Range("A1").CurrentRegion.AutoFilter Field:=6, Criteria1:="US Branch"
    ActiveSheet.Range("A1").CurrentRegion.AutoFilter Field:=3, Criteria1:=<>Array( _              <-- I have also tried ....Criteria1:=Array("<>1234", "<876428>"...so on..)
    "123456", "8654343", "5678334", "4624663", "67882542"), Operator:=xlFilterValues
    Range("A55").Select
    Range(Selection, ActiveCell.SpecialCells(xlLastCell)).Select
    Selection.EntireRow.Delete
    ActiveSheet.Range("A1").CurrentRegion.AutoFilter Field:=3
    ActiveSheet.Range("A1").CurrentRegion.AutoFilter Field:=6
    Range("B2").Select

Thank you for your time and help.
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
You can't use not equals with a Values Filter, sorry. That applies to <ACRONYM title="visual basic for applications">VBA</ACRONYM> and the user interface.
 
Upvote 0
Hmmmm...coz I thought since it works for a single value (not in array) I am doing something wrong. Always great to learn something new. Thank You!
Is there a work around you would suggest?
 
Upvote 0

Forum statistics

Threads
1,214,631
Messages
6,120,640
Members
448,974
Latest member
DumbFinanceBro

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top