1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| Private Sub ComboBox1_Change()
Me.ListBox1.Clear
For Each cel In pl
If CStr(cel.Value) = CStr(Me.ComboBox1.Value) Then
nl = cel.Row
Me.ListBox1.AddItem Sheets("Feuil1").Cells(nl, 1)
With Me.ListBox1
.List(.ListCount - 1, 1) = Sheets("Feuil1").Cells(nl, 2) & "|" & Sheets("Feuil1").Cells(nl, 3)
.List(.ListCount - 1, 2) = Sheets("Feuil1").Cells(nl, 4) & "|" & Sheets("Feuil1").Cells(nl, 5)
.List(.ListCount - 1, 3) = Sheets("Feuil1").Cells(nl, 6) & "|" & Sheets("Feuil1").Cells(nl, 7)
.List(.ListCount - 1, 4) = Sheets("Feuil1").Cells(nl, 8) & "|" & Sheets("Feuil1").Cells(nl, 9)
.List(.ListCount - 1, 5) = Sheets("Feuil1").Cells(nl, 10) & "|" & Sheets("Feuil1").Cells(nl, 11)
.List(.ListCount - 1, 6) = Sheets("Feuil1").Cells(nl, 12)
.List(.ListCount - 1, 7) = nl
End With
End If
Next cel
If Me.ListBox1.ListCount = 1 Then Me.ListBox1.ListIndex = 0
End Sub |
Partager