0

I have the following code:

myRange.AutoFilter Field:=1, Criteria1:="<>A", Operator:=xlAnd, Criteria2:="<>B", Operator:=xlAnd, Criteria3:="<>C"

it works if A, B, and C are in the column. However, I receive an error if for example A, and B are only present but not C. I need to make it work in the premise that A, B, or C may or may not be present in the column. Hope someone can help.

EDIT: Apparently the error came from adding Criteria 3 I'm stuck on how I can filter out more than 2 Criteria

Community
  • 1
  • 1

1 Answers1

0

To my knowledge you're unable to filter out more than 2 criteria's which is what you're running into.

I found the answer to a similar question I had here (filter out multiple criteria using excel vba)

Rather than restating their answer, see if that thread is helpful.

Community
  • 1
  • 1
Joe W
  • 111
  • 4