Private Sub ComboBox1_Change()
Dim L As Long
L = ComboBox1.ListIndex + 5
With Sheets("Clients")
Me.TextBox1 = .Cells(L, 4).Text 'Adresse
Me.TextBox2 = .Cells(L, 5).Text 'CP
Me.TextBox3 = .Cells(L, 6).Text 'Ville
Me.TextBox4 = .Cells(L, 7).Text 'Tel
Me.TextBox5 = .Cells(L, 8).Text 'Fax
Me.TextBox6 = .Cells(L, 9).Text 'Mobile
Me.TextBox7 = .Cells(L, 10).Text 'Email
End With
End Sub
Private Sub UserForm_Initialize()
Dim aa As Variant
aa = Feuil2.Range("C4:C" & Feuil2.Range("C65536").End(xlUp).Row)
ComboBox1.List = aa
End Sub
'Recherche par la combobox
Private Sub ComboBox1_Change()
Dim C As Range
With Sheets("Clients")
Me.TextBox1 = .Cells(ComboBox1.ListIndex + 5, 4).Text 'Adresse
Me.TextBox2 = .Cells(ComboBox1.ListIndex + 5, 5).Text 'CP
Me.TextBox3 = .Cells(ComboBox1.ListIndex + 5, 6).Text 'Ville
Me.TextBox4 = .Cells(ComboBox1.ListIndex + 5, 7).Text 'Tel
Me.TextBox5 = .Cells(ComboBox1.ListIndex + 5, 8).Text 'Fax
Me.TextBox6 = .Cells(ComboBox1.ListIndex + 5, 9).Text 'Mobile
Me.TextBox7 = .Cells(ComboBox1.ListIndex + 5, 10).Text 'Email
End With
End Sub
Private Sub UserForm_Initialize()
Dim aa As Variant
aa = Feuil2.Range("C4:C" & Feuil2.Range("C65536").End(xlUp).Row)
ComboBox1.List = aa
End Sub
'Recherche par la combobox
Private Sub ComboBox1_Change()
Dim C As Range
With Sheets("Clients")
Me.TextBox1 = .Cells(ComboBox1.ListIndex + 4, 4).Text 'Adresse
Me.TextBox2 = .Cells(ComboBox1.ListIndex + 4, 5).Text 'CP
Me.TextBox3 = .Cells(ComboBox1.ListIndex + 4, 6).Text 'Ville
Me.TextBox4 = .Cells(ComboBox1.ListIndex + 4, 7).Text 'Tel
Me.TextBox5 = .Cells(ComboBox1.ListIndex + 4, 8).Text 'Fax
Me.TextBox6 = .Cells(ComboBox1.ListIndex + 4, 9).Text 'Mobile
Me.TextBox7 = .Cells(ComboBox1.ListIndex + 4, 10).Text 'Email
End With
End Sub