From: JoeM on 15 Mar 2010 17:20 Could someone let me know if it is possible to print a multi-page tab in Excel to a PDF with multiple page orientations? Currently, I am setting the print area for each of the four pages and then printing each page seperatly to a PDF. Once complete I am combining each page into one PDF. I need all pages to print to one PDF with the proper size and orientation. My code is included below. Thank you in adavance for your help, Joe M Private Sub CommandButton2_Click() ans = MsgBox("Do you want to Export the Input page to PDF?", vbYesNo, "Confirmation") If ans = vbYes Then Sheets("Input").Select Sheets("Input").Activate Application.ActivePrinter = "Adobe PDF on Ne01:" ActiveWindow.SelectedSheets.PrintOut Copies:=1, ActivePrinter:= _ "Adobe PDF on Ne01:", Collate:=True Sheets("Input").Select Sheets("Input").Select Sheets("Input").Activate 'Prints Page 1 of Input tab With ActiveSheet.PageSetup .Orientation = xlLandscape .PaperSize = xlPaperLegal .Zoom = False .FitToPagesWide = 1 .FitToPagesTall = 1 End With Range("AssumptionsPrintArea").PrintOut 'Prints Page 2 of Input tab With ActiveSheet.PageSetup .Orientation = xlLandscape .PaperSize = xlPaperLegal .Zoom = False .FitToPagesWide = 1 .FitToPagesTall = 1 End With Range("EquityPrintArea").PrintOut 'Prints Page 3 of Input tab With ActiveSheet.PageSetup .Orientation = xlLandscape .PaperSize = xlPaperLegal .Zoom = False .FitToPagesWide = 1 .FitToPagesTall = 1 End With Range("RentAndExpensePrintArea").PrintOut 'Prints Page 4 of Input tab With ActiveSheet.PageSetup .Orientation = xlPortrait .PaperSize = xlPaperLegal .Zoom = False .FitToPagesWide = 1 .FitToPagesTall = 1 End With Range("SourcesUsesPrintArea").PrintOut 'resets the Page Setup to landscape and 4 pages long. With ActiveSheet.PageSetup .Orientation = xlLandscape .PaperSize = xlPaperLegal .Zoom = False .FitToPagesWide = 1 .FitToPagesTall = 4 End With End If End Sub
|
Pages: 1 Prev: Fill column question Next: How to use structured reference (ListColumns) in VBA |