1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| Sub PDF()
Worksheets("Feuil1").Activate
Dim fichier As String, Fichier2 As String, Zone As Range
fichier = ThisWorkbook.Path & ":mika.pdf"
Fichier2 = Replace(Replace(fichier, "Macintosh HD", ""), ":", "/")
' Fichier = ThisWorkbook.Path & Application.PathSeparator & "Répartition:test.pdf"
MsgBox Fichier2
ActiveSheet.PageSetup.PrintArea = "A4:D8"
'ActiveSheet.PageSetup.PrintArea = Selection.Address
Set Zone = Range("A4:D8")
Zone.ExportAsFixedFormat Type:=xlTypePDF, Filename:=Fichier2, Quality:= _
xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False, _
From:=1, To:=1, OpenAfterPublish:=False
End Sub |
Partager