Bonjour à tous,
Je n'arrive pas à afficher les différents cellules dans la listBox
Je procède comme suit:
Private Sub ComboBox2_Change()
ListBox1.Clear
'Option Explicit
With Sheets("Opérations").Activate
Dim i As Long
For i = 2 To 1000
If Cells(i, 2).Value = Me.ComboBox2.Text Then
Me.ListBox1.AddItem Cells(i, 2).Value
Me.ListBox1.List(Me.ListBox1.ListCount - 1, 1) = Cells(i, 1).Value
Me.ListBox1.List(Me.ListBox1.ListCount - 1, 2) = Cells(i, 3).Value
Me.ListBox1.List(Me.ListBox1.ListCount - 1, 3) = Cells(i, 4).Value
Me.ListBox1.List(Me.ListBox1.ListCount - 1, 4) = Cells(i, 5).Value
Me.ListBox1.List(Me.ListBox1.ListCount - 1, 5) = Cells(i, 6).Value
Me.ListBox1.List(Me.ListBox1.ListCount - 1, 6) = Cells(i, 7).Value
Me.ListBox1.List(Me.ListBox1.ListCount - 1, 7) = Cells(i, 8).Value
Me.ListBox1.List(Me.ListBox1.ListCount - 1, 8) = Cells(i, 9).Value
Me.ListBox1.List(Me.ListBox1.ListCount - 1, 9) = Cells(i, 10).Value
'End If
Next i
End With
End Sub
Le but final étant de pouvoir sélectionner une ligne de ma listbox, d'en afficher les informations dans un userform et d'imprimer une facture par la suite .
En piece jointe le fichier
D'avance merci,