1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| Private Sub ListBoxFOURN_Click()
Dim str As String
Dim cel As Range
ListBoxproduits.Clear
str = ListBoxFOURN.Value
With Worksheets("references")
For Each cel In .Range("F2:F" & .Range("F" & Rows.Count).End(xlUp).Row)
If cel = str Then
With ListBoxproduits
'en fonction des col voulues
.AddItem cel(1, -3)
.Column(1, .ListCount - 1) = VBA.Format(cel(1, -2), "#,##0.00 ")
.Column(2, .ListCount - 1) = VBA.Format(cel(1, 0), "#,##0.00 ")
.Column(3, .ListCount - 1) = VBA.Format(cel(1, 4), "#,##0.00 ")
.Column(4, .ListCount - 1) = cel(1, 5)
End With
End If
Next cel
End With
End Sub |
Partager