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

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.

oldbrewer

Board Regular
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,122,538
Messages
5,596,750
Members
414,097
Latest member
FaeFen

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