Bonjour à tous,

Je cherche un moyen de filtrer un tableau Excel à l'aide d'un Array. J'ai essayé une multitude de solutions mais impossible de trouver la bonne !
Le but de ce filtre est de filtrer toutes les lignes NE correspondant PAS au array.

Pour le moment j'ai essayé ça : (Tout le code n'y est pas, mais toutes les variables sont déclarées)

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
 
option explicit
 
sub Tri
 
Dim C1 As String, C2 As String, C3 As String, C4 As String, C5 As String, C6 As String
Dim C7 As String, C8 As String, C9 As String, C10 As String, C11 As String, C12 As String
Dim C13 As String, C14 As String
 
C1 = WsPrev.Range("A5")
C2 = WsPrev.Range("A6")
C3 = WsPrev.Range("A7")
C4 = WsPrev.Range("A8")
C5 = WsPrev.Range("A9")
C6 = WsPrev.Range("A10")
C7 = WsPrev.Range("A11")
C8 = WsPrev.Range("A12")
C9 = WsPrev.Range("A13")
C10 = WsPrev.Range("A14")
C11 = WsPrev.Range("A15")
C12 = WsPrev.Range("A16")
C13 = WsPrev.Range("A17")
C14 = WsPrev.Range("A18")
 
LigneBase = WsBase.Cells(Rows.Count, 1).End(xlUp).Row
 
WsBase.Range("A11:A" & LigneBase).AutoFilter field:=23, Criteria1:="<>" & Array(C1, C2, C3, C4, C5, C6, C7, C8, C9, C10, C11, C12, C13, C14), Operator:=xlAnd
Mais malheureusement, erreur d'exécution 13 : Incompatibilité de type

Si vous voyez l'erreur, n'hésitez plus !