Bonjour,
J'aimerais savoir comment faire pour selectionner la ligne correspondant a ma listbox.
Ci dessous le code de ma listbox.
D'avance je vous remercie
Cordialement
Max
J'aimerais savoir comment faire pour selectionner la ligne correspondant a ma listbox.
Ci dessous le code de ma listbox.
Code:
Private Sub ListBox1_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
Dim ListIndex As Integer
For ListIndex = 0 To (ListBox1.ListCount - 1)
If ListBox1.Selected(ListIndex) = True Then
CommandButton2.Visible = True
Me.TextBox1 = Me.ListBox1.List(ListIndex, 0) ' Ref
Me.txtNom = Me.ListBox1.List(ListIndex, 1) ' Nom
Me.TextBox3 = CDate(Me.ListBox1.List(ListIndex, 2)) ' Date
Me.TextBox4 = Me.ListBox1.List(ListIndex, 3) ' N° Facture
Me.txtAdresse = Me.ListBox1.List(ListIndex, 4) ' Adresse
Me.txtCP = Format(Me.ListBox1.List(ListIndex, 5), "00000") ' CP
Me.txtVille = Me.ListBox1.List(ListIndex, 6) ' Ville
Me.TextBox8 = Me.ListBox1.List(ListIndex, 7) ' Tél
Me.TextBox9 = Me.ListBox1.List(ListIndex, 8) ' Fax
Me.TextBox10 = Me.ListBox1.List(ListIndex, 9) ' Mobile
Exit Sub
End If
Next
End Sub
D'avance je vous remercie
Cordialement
Max