Autofilter with multiple criterias from a single cell

Ernest_PLM

New Member
Joined
Feb 13, 2013
Messages
2
Hi,

I have a spreadsheet that that I am trying to run a macro that does an Autofilter on a range Sheets("Criteria").Range("A1:L2").

Here is the VBA code that does the autofilter:

Sheets("Source").Range("A1:L108784").AdvancedFilter Action:=xlFilterCopy, _
CriteriaRange:=Sheets("Criteria").Range("A1:L2"), CopyToRange:=Range("A1") _
, Unique:=False

What i would like to do is have the value in Sheets("Criteria") Cell D2 & H2 to be able to have multiple criteria. I have tried putting "=or("text1","Text2")" in the cell as other forums have suggested but this doesn't work.

Am i able to do this and if so how?
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"

Forum statistics

Threads
1,216,231
Messages
6,129,631
Members
449,522
Latest member
natalia188

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