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

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.

oldbrewer

Well-known Member
Joined
Apr 11, 2010
Messages
11,004
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,699
Messages
5,626,382
Members
416,176
Latest member
Dyl

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