Sub PDF()
Sheets("Result").Activate
ActiveSheet.UsedRange.Select
ThisWorkbook.Sheets(Array("Result")).Select
Selection.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
"C:\Users\etavernaro\Desktop\Tax_Rulings_Database.pdf", Quality:=xlQualityStandard, _
IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:= _
True
With ActiveSheet.PageSetup
.PrintArea = Worksheets("Result").UsedRange
.Orientation = xlLandscape
.FitToPagesWide = 1
.FitToPagesTall = 1
.Zoom = False 'I have added this line
End With
End Sub
Is it possible to specify that the output on PDF gets separated on to two pages? I am exporting a worksheet to a PDF but because there are so many columns the font size is very small. If I could split the output to two pages that would be fantastic.
In advance many thanks for your help!
I got it so far that it splits the sheet into three pages (with FitToPages) but now I would like that it ignores the entire first row of the sheet when generating the PDF.
Sheets("Result").Range("B2:U100").ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
Above I specified that it exports the range B2:U100 to the PDF. In that way it would ignore the first row (=A). The problem is, that the "Result" sheet has not always the same amount of data and therefore at times it also copies blank cells to the PDF. Is it possible to specify above code so that it ignores the first row (=A) and ONLY copies those rows to the PDF that are filled?
Bookmarks