Sub pdf()
SousDossier = Left(Range("F3"), 2)
nomdossier = Application.InputBox("Dossier d'enregistrement", "Enregistrer en PDF....!", "Bon de livraison")
dossier = ThisWorkbook.Path & "/" & nomdossier & "/" & SousDossier & "/"
On Error Resume Next
If dossier = True Then
GetAttr (dossier) And vbDirectory
Else
MkDir (dossier)
End If
ActiveSheet.ExportAsFixedFormat Type:=xltypdf, _
Filename:=dossier & Range("F2").Value & "_" & "commande N°" & " " & Range("F3").Value & ".pdf", _
quality:=xlQualityStandard, ignoreprintareas:=False, _
includedocproperties:=True, _
from:=1, to:=1, _
openafterpublish:=False
Sheets("Bon").Range("G3").Value = Sheets("Bon").Range("G3").Value + 1
End Sub