Private Sub CommandButton1_Click()
Dim Inc As Integer, Ind As Integer, MonTab() As String
' Indice du tableau à 0
Ind = 0
' Pour chaque combo
For Inc = 1 To 3
' Tester si une valeur existe
If Me("Combobox" & Inc).Value <> "" Then
' Si oui on redimensionne le tableau en conservant ce qui existe
ReDim Preserve MonTab(Ind)
' On attribue la valeur
MonTab(Ind) = Me("Combobox" & Inc).Value
' On incrémente l'indice
Ind = Ind + 1
End If
Next
If ComboBox1 <> "" Then
' Field/Champ 4 = Colonne D
Sheets("verification").Range("$A$6:$D$1000").AutoFilter Field:=4, _
Criteria1:=MonTab, Operator:=xlFilterValues
End If
End Sub