Dim F As Worksheet, d As Object, a
Private Sub UserForm_Initialize()
Set F = ThisWorkbook.Worksheets("Mouvement")
Set d = CreateObject("Scripting.Dictionary")
a = F.Range("B7:O" & F.[B65000].End(xlUp).Row) ' tableau a(n,1) pour rapidité
For i = LBound(a) To UBound(a)
If a(i, 2) <> "" Then
If Not d.exists(Month(a(i, 2))) = "" Then d(Month(a(i, 2))) = ""
End If
Next i
Me.ComboBox1.List = d.keys
End Sub
Private Sub ComboBox1_click()
ListBox1.ColumnCount = 14
clé = Me.ComboBox1: n = 0
Dim Tbl()
For i = 1 To UBound(a)
If Month(a(i, 2)) Like clé Then
n = n + 1
ReDim Preserve Tbl(1 To UBound(a, 2), 1 To n)
For k = 1 To UBound(a, 2)
Tbl(k, n) = a(i, k)
Next k
End If
Next i
If n > 0 Then Me.ListBox1.Column = Tbl Else Me.ListBox1.Clear
End Sub