Hi Everyone,
My apologies in advance if this has already been answered; my searching has proven fruitless!
I am attempting to export different ranges of the same sheet as separate pages of a single pdf document. What I am after is:
Page 1 of the pdf:
With ActiveSheet.PageSetup
.Orientation = xlPortrait
.PrintArea = "B1:H54"
End With
Page 2 of the pdf.
With ActiveSheet.PageSetup
.Orientation = xlLandscape
.PrintArea = "J1:W54"
End With
Page 3 of the pdf.
With ActiveSheet.PageSetup
.Orientation = xlPortrait
.PrintArea = "Y1:AG54"
End With
Then something like this after where it exports the document to the spreadsheet file path and file name.
ActiveSheet.ExportAsFixedFormat Type:=x1TypePDF, _
Filename:=ActiveWorkbook.Path & "" & strFileName & ActiveSheet.Name, _
Quality:=xlQualityStandard, _
OpenAfterPublish:=True
So in summary, page 1 of the pdf should be exported as a portrait page between range "B1:H54", page 2 of the pdf should be landscape between range "J1:W54" and page 3 of the same pdf should be portrait between the ranges "Y1:AG54".
I would be very appreciative if someone could please help out with this. I'm way out of my depth on this one!
My apologies in advance if this has already been answered; my searching has proven fruitless!
I am attempting to export different ranges of the same sheet as separate pages of a single pdf document. What I am after is:
Page 1 of the pdf:
With ActiveSheet.PageSetup
.Orientation = xlPortrait
.PrintArea = "B1:H54"
End With
Page 2 of the pdf.
With ActiveSheet.PageSetup
.Orientation = xlLandscape
.PrintArea = "J1:W54"
End With
Page 3 of the pdf.
With ActiveSheet.PageSetup
.Orientation = xlPortrait
.PrintArea = "Y1:AG54"
End With
Then something like this after where it exports the document to the spreadsheet file path and file name.
ActiveSheet.ExportAsFixedFormat Type:=x1TypePDF, _
Filename:=ActiveWorkbook.Path & "" & strFileName & ActiveSheet.Name, _
Quality:=xlQualityStandard, _
OpenAfterPublish:=True
So in summary, page 1 of the pdf should be exported as a portrait page between range "B1:H54", page 2 of the pdf should be landscape between range "J1:W54" and page 3 of the same pdf should be portrait between the ranges "Y1:AG54".
I would be very appreciative if someone could please help out with this. I'm way out of my depth on this one!