VBA- Filter not equal to with Special characters and phrases

t7979rb

New Member
Joined
Dec 3, 2018
Messages
3
I am trying to create a filter with NOT EQUAL TO on a large table. The filter column has phrases and phrases with "/" and "-" type special characters. A small example is attached. I want to filter on the column names Title. I need the result to be the last row "Technical Lead Engineer only. I need to use the "NOT EQUAL TO" since I have approx. 1000 rows and I want to see all except the 10 I select. Here is my code, For some reason the "SIR Engineer" row seems to filter out and not the other two. Any suggestions?

Sub Filt()
ActiveSheet.ListObjects("Table10").Range.AutoFilter Field:=2, _
Criteria1:=Array("<>Structure/Chassis/Body _ Engineer", "<>SIR", "<>SIR Engineer"), Operator:=xlAnd
End Sub

DeptTitleTime
SafetySIR
0.160097​
DurabilitySIR Engineer
0.007352​
NVHStructure/Chassis/Body _ Engineer
0.012752​
NVHTechnical Lead Engineer
0.004267​
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
I dont think we have a straight forward approach to it like what you did. There are many workarounds though
 
Upvote 0
You have to either use advanced filter using a criteria range with 3 titles like the below OR create a helper column in code and use normal auto filtering from that instead

TitleTitleTitle
<>*SIR*
<>*SIR Engineer*<>*Structure/Chassis/Body_Engineer*



..
 
Upvote 0
Thanks all. Question
If I don't use the <> function it works. Do you guys know if there is a way to reverse the filters.
 
Upvote 0
Thanks all. Question
If I don't use the <> function it works. Do you guys know if there is a way to reverse the filters.

The limitation is with not equal and also wildcards and you can only have 2. The equal to criteria you can have many in an array.
 
Upvote 0

Forum statistics

Threads
1,215,019
Messages
6,122,707
Members
449,093
Latest member
Mnur

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