-3

criteria 1:= Array("<>David","<>Steven") .... Isn't working in vb Macro excel

Please help me, why not working when I give comparison not equals in Array by Filter.

braX
  • 11,506
  • 5
  • 20
  • 33
  • 2
    Welcome to SO. Please see [How to create a Minimal, Complete, and Verifiable example](https://stackoverflow.com/help/mcve) and don't forget to read [Why is β€œCan someone help me?” not an actual question?](https://meta.stackoverflow.com/questions/284236/why-is-can-someone-help-me-not-an-actual-question). Also check out the [tour](https://stackoverflow.com/tour), and more good information at ["help center".](https://stackoverflow.com/help/on-topic) – Foxfire And Burns And Burns Oct 22 '18 at 07:12

1 Answers1

2

You can specify up to two 'does-not-equal' criteria in an AutoFilter.

with myFilterRange
    .AutoFilter Field:=1, Criteria1:="<>David", _
                Operator:=xlAnd, Criteria2:="<>Steven"
end with

For additional 'does-not-equal' criteria, see Excel VBA autofilter all but three.

  • Thanks sir. But I will create filter multiple in Array...like this: Array(get data from sheet).. and in data Array I want give not equals comparison. – MUHAMMAD AINUL YAQIN Oct 22 '18 at 07:21