Dim TblBD(), NbCol, NomTableau
Private Sub UserForm_Initialize()
TblBD = [Tableau1].Value
'--- construction des cases d'options régions
Set d = CreateObject("scripting.dictionary")
For i = 1 To UBound(TblBD): d(TblBD(i, 5)) = "": Next i
Me.ListBox1.List = d.keys
B_tout_Click
End Sub
Private Sub ListBox1_Change()
Dim Tbl()
For i = 0 To Me.ListBox1.ListCount - 1
If Me.ListBox1.Selected(i) = True Then
n = n + 1: ReDim Preserve Tbl(1 To n)
Tbl(n) = Me.ListBox1.List(i)
End If
Next i
If n > 0 Then Sheets("bd").[A1].AutoFilter Field:=5, Criteria1:=Tbl, Operator:=xlFilterValues Else Sheets("bd").[A1].AutoFilter
End Sub