Filtering for three or criteria

jordanburch

Active Member
Joined
Jun 10, 2016
Messages
440
Office Version
  1. 2016
Hey Guys,

I am not sure if you can have three different or criteria on a filter, but this seems to not work. Can anyone help?

ActiveSheet.Range("$A$1:$AY$7000").AutoFilter Field:=15, Criteria1:= _
Right(ThisWorkbook.Worksheets("Variables").Range("A3").Value, 1) & Right(ThisWorkbook.Worksheets("Variables").Range("A10").Value, 2) & "INT", Operator:=xlOr, Criteria2:=Right(ThisWorkbook.Worksheets("Variables").Range("A3").Value, 1) & Right(ThisWorkbook.Worksheets("Variables").Range("A6").Value, 2) & "INT", Operator:=xlOr, Criteria3:="="

basically the first two look like this 104INT 105INT and the last one I want to include blanks. So if it is

104INT
105INT
blank
want

if its
111INT
Dont want

does this make sense?

1004 error application error is what im getting. thanks in advance.

Jordan
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
How about
VBA Code:
   Dim x As Variant
   With ThisWorkbook.Worksheets("Variables")
      x = Array(Right(.Range("A3").Value, 1) & Right(.Range("A10").Value, 2) & "INT", Right(.Range("A3").Value, 1) & Right(.Range("A6").Value, 2) & "INT", "")
   End With
   ActiveSheet.Range("$A$1:$AY$7000").AutoFilter 15, x, xlFilterValues
 
Upvote 0
How about
VBA Code:
   Dim x As Variant
   With ThisWorkbook.Worksheets("Variables")
      x = Array(Right(.Range("A3").Value, 1) & Right(.Range("A10").Value, 2) & "INT", Right(.Range("A3").Value, 1) & Right(.Range("A6").Value, 2) & "INT", "")
   End With
   ActiveSheet.Range("$A$1:$AY$7000").AutoFilter 15, x, xlFilterValues
works! as always thanks a bunch fluff!
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,905
Messages
6,122,175
Members
449,071
Latest member
cdnMech

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