如何仅使用VBA在一张纸上将多个范围导出为PDF

时间:2019-05-31 09:28:39

标签: excel vba

我正在尝试将多个范围导出到PDF并仅适合一张纸,但缺少解决此问题的属性?现在,在一个PDF上将其拆分为两个多页。

Sub Printing()
Application.PrintCommunication = False
With ActiveSheet.PageSetup
.Zoom = False
.Orientation = xlPortrait
.FitToPagesWide = 1
.FitToPagesTall = False
.PrintArea = ActiveSheet.Range("A01:R6, A26:R50").Address
 End With
 Application.PrintCommunication = True

 fname = ThisWorkbook.Path & "\test.pdf"
 ActiveSheet.ExportAsFixedFormat _
 Type:=xlTypePDF, _
 Filename:=fname, _
 Quality:=xlQualityStandard, _
 IgnorePrintAreas:=False, _
 IncludeDocProperties:=True, _
 OpenAfterPublish:=True

 End Sub

0 个答案:

没有答案
相关问题