Filter critetria

Genzz

New Member
Joined
Jun 17, 2005
Messages
22
Hi All
I need to more than 2 criteria filters in one column, I using this code but doesn't work.
Code:
Sub filter2()
'
' filter2 Macro

    Selection.filter Field:=1, Criteria1:=">BV53", Operator:=xlOr, _
        Criteria2:="<BV190", Operator:=xlAnd, Criteria3:="<>*c*"
    Selection.AutoFilter Field:=2, Criteria1:="8.00%"
End Sub

Many Thanks
Genzz
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
I am not an expert in this because I generally use pivot tables. However, using Data/Filter/Advance Filter it is theoretically possible to have as many criteria as you want.

It requires that a separate Criteria range is set up. The best method is to copy/paste the column headings, and then put criteria underneath. This range has to be on the same worksheet, so I find it best to put it *above* the main table otherwise these rows get hidden too.

There needs to be an empty row above the table. Do not include empty rows in the criteria range otherwise nothing happens. It is possible to put references to other cells in the criteria range. Excel makes a named range called "Criteria".

After filtering we get the menu option to "Show All".

It is possible to copy filtered data elsewhere *in the same worksheet*
 
Upvote 0

Forum statistics

Threads
1,226,222
Messages
6,189,706
Members
453,566
Latest member
ariestattle

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