Apply filter using more than two wildcards

Tejas Kore

Board Regular
Joined
Nov 2, 2017
Messages
60
Hi Friends,

Linux = Array("*Linux*", "*Solaris*", "*Sun OS*")
d.Add "WindowsOS", WindowsOS
d.Add "Linux", Linux
.
.
.
.
ActiveSheet.Columns.AutoFilter field:=Columns(vcolumn).Column, Criteria1:=d.Items()(i), Operator:=xlFilterValues

As u all know here d.Items()(i) will be Array("*Linux*", "*Solaris*", "*Sun OS*").

I am trying to apply filter based on more than two wildcards but it seems that u cannot do that. I ran the code and it gave blank sheet .

Do we have any other alternative method to do this ?
 

Some videos you may like

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.

oldbrewer

Well-known Member
Joined
Apr 11, 2010
Messages
11,005
it might be better if you made a pretend spreadsheet then asked how best to filter it - I personally have no idea what d.add is....
 

Tejas Kore

Board Regular
Joined
Nov 2, 2017
Messages
60
Hi oldbrewer,

Here 'd' is a dictionary where key is a string which I have used to rename file and item is a array of multiple wildcards(specially more than 2 wildcards).
Due to some constraints , I didn't paste the whole code. I shoudn't have pasted first 3-4 lines.

I wanted to know in the below line what changes need to be made so that we can add more than 2 wildcards.

ActiveSheet.Columns.AutoFilter field:=Columns(vcolumn).Column, Criteria1:=d.Items()(i), Operator:=xlFilterValues

'''''d.items()(i)=Array("*Linux*", "*Solaris*", "*Sun OS*")

 
Last edited:

Watch MrExcel Video

Forum statistics

Threads
1,127,208
Messages
5,623,393
Members
415,971
Latest member
gishy

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
Top