1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| Sub EnregistreFacture()
'Déclaration des variables
Dim NomDossier As String
Dim CheminDossier As String
On Error GoTo 1
'Nom de dossier
NomDossier = Application.InputBox("Dossier Enregistrement :", "Dossier")
CheminDossier = "D:\Mes Documents\Excel\Facture\" & NomDossier & "\"
If NomDossier = "" Then Exit Sub
'Enregistrement au format PDF
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
CheminDossier & "Facture_" & Range("C6").Value & ".pdf", quality:= _
xlQualityStandard, includedocproperties:=True, ignoreprintareas:=False, _
from:=1, To:=1, openafterpublish:=True
1
End Sub |
Partager