In my the spread sheet, I have defined a range, which needs to be excluded from the filter. The values to exclude are filled dynamically filled in the range & will be more than 3 in most of the cases. I intend to use the code similar to what is shown below. varFilterValues is an array populated with values from the named range. But I'm struggling on how to exclude these from the filter. I'm sure it must be a silly mistake in defining the 'not equal to' array in Criteria1. Can any one point where the mistake is please? I searched internet but couldn't find simple & appropriate solution.
I know the following code works when I want to add filter using similar method & define criteria 'equal' to an array. I was expecting similar for 'not equal to' an array condition also.
Code:
[B] ActiveSheet.Range("$A$1:$V$100").AutoFilter Field:=9, _
Criteria1:[COLOR=#ff0000]<>varFilterValues[/COLOR], _
Operator:=xlAnd[/B]
I know the following code works when I want to add filter using similar method & define criteria 'equal' to an array. I was expecting similar for 'not equal to' an array condition also.
Code:
ActiveSheet.Range("$A$1:$V$100").AutoFilter Field:=9, _
Criteria1:[COLOR=#008000]=varFilterValues[/COLOR], _
Operator:=xlFilterValues