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 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
|
Private Sub CommandButton1_Click()
Dim contacts As Object
Dim nom As String
Dim ligNom As Integer
Dim cellule As Object
Set contacts = Sheets("Contacts")
nom = Me.cmbListRecherche
ligNom = False
For Each cellule In Range("rechnom")
If cellule = nom And ligNom = False Then
ligNom = cellule.Row
End If
Next cellule
If ligNom <> False Then
usfEnregistrement.cmbListbra.Value = contacts.Cells(ligNom, 1).Value
usfEnregistrement.cmbListact.Value = contacts.Cells(ligNom, 2).Value
usfEnregistrement.cmbListdépart.Value = contacts.Cells(ligNom, 3).Value
usfEnregistrement.txtNom.Value = contacts.Cells(ligNom, 4).Value
usfEnregistrement.txtAdres1.Value = contacts.Cells(ligNom, 5).Value
usfEnregistrement.txtAdres2.Value = contacts.Cells(ligNom, 6).Value
usfEnregistrement.txtAdres3.Value = contacts.Cells(ligNom, 7).Value
usfEnregistrement.txtCpost.Value = contacts.Cells(ligNom, 8).Value
usfEnregistrement.txtVille.Value = contacts.Cells(ligNom, 9).Value
usfEnregistrement.txtPays.Value = contacts.Cells(ligNom, 10).Value
usfEnregistrement.cmbListCiv1.Value = contacts.Cells(ligNom, 12).Value
usfEnregistrement.txtInt1.Value = contacts.Cells(ligNom, 13).Value
usfEnregistrement.txtTel1.Value = contacts.Cells(ligNom, 14).Value
usfEnregistrement.txtFax1.Value = contacts.Cells(ligNom, 15).Value
usfEnregistrement.txtMob1.Value = contacts.Cells(ligNom, 16).Value
usfEnregistrement.txtMail1.Value = contacts.Cells(ligNom, 17).Value
usfEnregistrement.cmbListCiv2.Value = contacts.Cells(ligNom, 18).Value
usfEnregistrement.txtInt2.Value = contacts.Cells(ligNom, 19).Value
usfEnregistrement.txtTel2.Value = contacts.Cells(ligNom, 20).Value
usfEnregistrement.txtFax2.Value = contacts.Cells(ligNom, 21).Value
usfEnregistrement.txtMob2.Value = contacts.Cells(ligNom, 22).Value
usfEnregistrement.txtMail2.Value = contacts.Cells(ligNom, 23).Value
Unload Me
usfEnregistrement.Show
Else
MsgBox ("Le nom" & nom & " est introuvable")
End If
End Sub |
Partager