Multiple criteria in filters, pre 2007

Weaver

Well-known Member
Joined
Sep 10, 2008
Messages
5,197
Working in VB, is it possible to have more than 2 filter criteria in an autofilter in pre 2007 Excel?
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
Or, depending on what you are doing, you could store the criteria in an array and then loop through that array, assigning each item to the filter. For instance, to delete rows matching more than two criteria:
Code:
Dim varArr as Variant, lngArrItem as Long
varArr=Array("a","b","c")

For lngArrItem = Lbound(varArr) to Ubound(varArr)
    With Range("A1:A100")
        .Filter Field:=1, Criteria1:=varArr(lngArrItem)
        .Offset(1).SpecialCells(12).EntireRow.Delete
        .AutoFilter
    End With
Next lngArrItem

You could adapt for copy too...
 
Upvote 0
Nice idea Jon, in fact I think I've suggested similar myself.

My problem is they have to display at the same time tho.

Anyone know if there's an advanced filter wizard kicking around?
 
Upvote 0

Forum statistics

Threads
1,214,940
Messages
6,122,361
Members
449,080
Latest member
Armadillos

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