Private Sub CommandButton4_Click()
Dim LaDate$, Nom$, Rep$ 'DŽclaration des variables
LaDate = Format(Now, "yyyy_mm_dd")
Nom = Range("D2").Value 'Nom de l'onglet ˆ entregistrer
Rep = "M:\blabla\" ' Chemin du rŽpertoire ˆ adapter depuis votre PC"
Sheets(2).ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
Rep & LaDate & "_" & Nom & ".pdf", Quality:= _
xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False, _
From:=1, to:=5, OpenAfterPublish:=False 'enregistrement du fichier en PDF
MsgBox "the file has been converted to PDF"
End Sub