Private Sub UserForm_Initialize()
'Déclaration des Variables
Dim NomImage As String
Dim Matricule As Integer
Dim MaSource As Range
Dim DossierPhoto As String
'Affectation des Variables
'''' MODIF STAPLE DossierPhoto = ThisWorkbook.Path & "\Photos\"
Set MaSource = shData.Range("A1").CurrentRegion
Matricule = shListe.Range("B13")
Me.lblMessage = "Vous allez réaliser une " & shListe.Range("B10")
Me.lblType = shListe.Range("B10")
'On réaliser des RechercheV (VLookUp) dans la source
Me.txtMatricule = Application.WorksheetFunction.VLookup(Matricule, MaSource, 1, 0)
Me.txtNom = Application.WorksheetFunction.VLookup(Matricule, MaSource, 2, 0)
Me.txtPrenom = Application.WorksheetFunction.VLookup(Matricule, MaSource, 3, 0)
Me.txtAge = Application.WorksheetFunction.VLookup(Matricule, MaSource, 4, 0)
Me.txtTel = Application.WorksheetFunction.VLookup(Matricule, MaSource, 5, 0)
Me.txtAdresse = Application.WorksheetFunction.VLookup(Matricule, MaSource, 6, 0)
Me.txtDateEmbauche = Format(Application.WorksheetFunction.VLookup(Matricule, MaSource, 7, 0), "DD/MM/YYYY")
If Me.cboContrat = "CDD" Then
Me.lblDateFinContrat.Visible = True
Me.txtFinContrat.Visible = True
Me.txtFinContrat = Format(Application.WorksheetFunction.VLookup(Matricule, MaSource, 9, 0), "DD/MM/YYYY")
End If
Me.cboContrat = Application.WorksheetFunction.VLookup(Matricule, MaSource, 8, 0)
Me.cboTerritoire = Application.WorksheetFunction.VLookup(Matricule, MaSource, 10, 0)
Me.txtPoste = Application.WorksheetFunction.VLookup(Matricule, MaSource, 11, 0)
Me.cboChamp = Application.WorksheetFunction.VLookup(Matricule, MaSource, 12, 0)
Me.txtLieu = Application.WorksheetFunction.VLookup(Matricule, MaSource, 13, 0)
If Application.WorksheetFunction.VLookup(Matricule, MaSource, 14, 0) <> "ImageVide" Then
Me.chkPhoto = True
Else
Me.chkPhoto = False
End If
Me.lblNomImage.Caption = Application.WorksheetFunction.VLookup(Matricule, MaSource, 14, 0)
''''MODIF'''STAPLE'''''''''''''''''''''''''''On affiche l'image du Salarié dans le Formulaire
'NomImage = Me.lblNomImage.Caption
'Me.Image1.Picture = LoadPicture(DossierPhoto & NomImage & ".jpg")
End Sub