Private Sub CommandButton1_Click()
Dim chemin$, repertoire$
chemin = "c:\mesdocuments\"
repertoire = Range("a1")
' créer le fichier
If Dir(chemin & repertoire, vbDirectory) = "" Then
MkDir chemin & repertoire
End If
'enregistre classeur
ActiveWorkbook.ExportAsFixedFormat Type:=xlTypePDF, Filename:=chemin & repertoire & "\" & [a2].Value & " " & ".pdf"
'message d'enregistrement
Application.ScreenUpdating = True
MsgBox ("Le(s) document(s) PDF viennent d'être créés et sont disponibles dans le répertoire C:\mesdocuments")
End Sub