Printing multi-page and multi-orientation excel tab to PDF

J

JoeM

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top