I have a question regarding Excel and VBA. I want to export multiple sheets as a PDF. My code works fine. What I want to do now is, merge multiple sheets on one page. Due to the height and width it makes sense to put two sheets together on one page. If I want to print it with my printer it works fine with the printer page layout setting. Is there a page layout code for vba to put two sheets onto one page together? Thanks in advance.
End Sub
Best regards,
Sub SavePDF()
Dim mySheets As Variant, sh
mySheets = Array("Sheet 1", "Sheet 2", "Sheet 3", "Sheet 4")
For Each sh In mySheets
Application.PrintCommunication = False
With ActiveSheet.PageSetup
.PrintArea = "$A$1:$V$70"
.Orientation = xlPortrait
.CenterHorizontally = True
.FitToPagesWide = 1
End With
Application.PrintCommunication = True
Next
Sheets(mySheets).Select
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, _
Filename:="C:\Users\tstaecker\test.pdf", _
IgnorePrintAreas:=True, OpenAfterPublish:=False
End Sub