Save as PDF in Landscape

前端 未结 1 1354
挽巷
挽巷 2020-12-20 22:54

How can I pdf multiple sheets in my Workbook into one pdf in landscape format? Here is what I have. I am missing the landscape syntax -

Sub CompileReport()

         


        
相关标签:
1条回答
  • 2020-12-20 23:53

    Try this one:

    Sub CompileReport()
        Dim mySheets As Variant, sh
    
        mySheets = Array("Sheet1", "Sheet2", "Sheet3")
        For Each sh In mySheets
            Sheets(sh).PageSetup.Orientation = xlLandscape
        Next
    
        Sheets(mySheets).Select
        ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:="F:\Report\Test" & ".pdf", _
            Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False
    End Sub
    
    0 讨论(0)
提交回复
热议问题