Sub SauvPdf()
'
NomDossier = Application.InputBox("Nom du dossier", "Création du dossier", "Entrer le nom du dossier")
If NomDossier = "" Then Exit Sub
Chemin = "I:\agent\pdf\" & NomDossier & "\"
On Error Resume Next
Dossierexistant = GetAttr(dossier) And vbDirectory
If Dossierexistant = False Then MkDir (Chemin)
NomComplet = Chemin & Format(Range("A1").Value, "mmmm yyyy") & " - " & Range("A6").Value & ".pdf"
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, _
Filename:=NomComplet, _
Quality:=xlQualityStandard, _
IncludeDocProperties:=True, _
IgnorePrintAreas:=False, _
From:=1, _
To:=1, _
OpenAfterPublish:=True
MsgBox ("Le pdf a été créé")
End Sub