1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
| Private Sub ComboBox1_Change()
Dim Lig As Integer
Feuil1.TextBox1.Value = Feuil1.ComboBox1.Text
'recherche le nom et prénom dans la liste
With Feuil2.Range("B:B")
Set c = .Find(ComboBox1, LookIn:=xlValues, LookAt:=xlWhole)
If Not c Is Nothing Then Lig = c.Row
End With
'renvoi les valeurs de tableau1 dans les differents textbox
Feuil1.TextBox3.Value = Feuil2.Cells(Lig, 3).Value
Feuil1.TextBox4.Value = Feuil2.Cells(Lig, 4).Value
Feuil1.TextBox5.Value = Feuil2.Cells(Lig, 6).Value
Feuil1.TextBox6.Value = Feuil2.Cells(Lig, 7).Value
Feuil1.TextBox7.Value = Feuil2.Cells(Lig, 8).Value
Feuil1.TextBox8.Value = Feuil2.Cells(Lig, 9).Value
Feuil1.TextBox9.Value = Feuil2.Cells(Lig, 10).Value
Feuil1.TextBox10.Value = Feuil2.Cells(Lig, 5).Value
'plus si affinité
ville:
If Feuil2.Cells(Lig, 2).Font.ColorIndex = -4105 Then
Feuil1.TextBox2.Value = Feuil2.Cells(Lig, 2).Value
Exit Sub
Else
Lig = Lig - 1
GoTo ville
End If
End Sub |