Hi,
I am using the following code to generate a PDF. This code puts the selected sheets together as a PDF, in the order that they are found in on excel. I need some code that will make sure the pdf goes in order: "Summary", "Breakdown", "Entry". But i cannot just re-arrange the sheets manually. Thanks.
Sub PrintPDF()
Dim MyPath
Dim MyFolder
Sheets(Array("Entry", "Breakdown", "Summary")).Select
With ActiveSheet.PageSetup
.Orientation = xlPortrait
.Zoom = False
.FitToPagesWide = 1
.CenterHorizontally = True
.CenterVertically = True
.BottomMargin = 0
.TopMargin = 0
.RightMargin = 0
.LeftMargin = 0
End With
MyPath = ThisWorkbook.Path
MyFolder = Application.GetSaveAsFilename(MyPath, "PDF Files (*.pdf),*.pdf")
If MyFolder = False Then Exit Sub
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, _
Filename:=MyFolder, _
Quality:=xlQualityStandard, _
IncludeDocProperties:=True, _
IgnorePrintAreas:=False, _
OpenAfterPublish:=True
Sheets("Entry").Select
End Sub
Bookmarks