Private Sub ListBox2_Change()
Dim Tablo, Tabcode, AlimLB()
Dim k As Integer, y As Integer, x As Integer, z As Integer
If ListBox2.ListIndex = -1 Then Exit Sub
Tabcode = Sheets("Feuil2").Range("A2:B" & Sheets("Feuil2").Cells(Rows.Count, "A").End(xlUp).Row).Value
LigneSel = ListBox2.ListIndex + 2
x = 1
With ListBox1
.ColumnCount = 4
.ColumnWidths = "220;60;60;50"
End With
With Sheets("Feuil1")
TextBox1 = .Range("A" & LigneSel).Value
Tablo = .Range("A2:M" & .Cells(Rows.Count, "A").End(xlUp).Row).Value
End With
For k = LBound(Tablo, 1) To UBound(Tablo, 1)
If Tablo(k, 1) = TextBox1 Then
For y = 2 To 11 Step 3
For z = LBound(Tabcode, 1) To UBound(Tabcode, 1)
If Tablo(k, y) = Tabcode(z, 1) Then
ReDim Preserve AlimLB(1 To 4, 1 To x)
AlimLB(1, x) = Tabcode(z, 2)
AlimLB(2, x) = Tablo(k, y)
AlimLB(3, x) = Tablo(k, y + 1)
AlimLB(4, x) = Tablo(k, y + 2)
x = x + 1
End If
Next
Next
End If
Next
ListBox1.List = Application.Transpose(AlimLB)
End Sub