Sub Fichier_pdf()
Dim sRep As String
Dim sFilename As String
Dim LHeure As String
Dim LaDate As String
Dim Nom As String
LHeure = Format(Time, "HMS")
LaDate = Format(Date, "dd" & "." & "mm" & "." & "yyyy")
Nom = "Création du bordereau le"
With ActiveSheet.PageSetup
.LeftFooter = ""
.CenterFooter = ""
.RightFooter = ""
End With
Sheets(Array("Page_Explicative", "1 - Bordereau de transfert", "Page_5")).Select
sRep = ThisWorkbook.Path
sFilename = Nom & " " & LaDate & " " & LHeure & ".pdf"
ActiveSheet.ExportAsFixedFormat _
Type:=xlTypePDF, _
Filename:=sRep & "\" & sFilename, _
Quality:=xlQualityStandard, _
IncludeDocProperties:=True, _
IgnorePrintAreas:=False, _
OpenAfterPublish:=True
' Message de confirmation
MsgBox "Création du fichier PDF a été effectuée", Title:="Mon document"
End Sub