1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
|
Private Sub CommandButton1_Click()
Dim plage As Range
Set plage = Sheets("Feuil1").Range("D6:D" & [D65536].End(xlUp).Row)
codrecherché = CDbl(TextBox1.Value)
i = 0
For Each Cell In plage
If Cell.Value = codrecherché Then
MsgBox codrecherché
USF_SORTIE.ListBox1.ColumnCount = 3
USF_SORTIE.ListBox1.ColumnWidths = "40;40;100"
USF_SORTIE.ListBox1.AddItem
USF_SORTIE.ListBox1.Column(0, i) = Cell(1, 2)
USF_SORTIE.ListBox1.Column(1, i) = Cell(1, 3)
USF_SORTIE.ListBox1.Column(2, i) = Cell(1, 5)
i = i + 1
End If
Next Cell
End Sub |
Partager