Hello All,
Apologies in advance for the long type to follow...
But I have a situation where I thought I had the PageSetup going smooth. But the product I receive is just a snippet of what I am after and it keeps slicing my tables off at the page breaks. See Code Below↓ I left out the codes for coloring as it was a bit much, but basically everything surrounding the tables is vbCYAN which is what I'm trying to preserve.
I have attached links to what is my result vs. what I am after.
Bad (Table on bottom is cutoff and no blue to be found): http://i.imgur.com/RagFiU0.jpg
Good (Cyan all around is preserved): http://i.imgur.com/B4i843F.png
In the code I have played with the:
Apologies in advance for the long type to follow...
But I have a situation where I thought I had the PageSetup going smooth. But the product I receive is just a snippet of what I am after and it keeps slicing my tables off at the page breaks. See Code Below↓ I left out the codes for coloring as it was a bit much, but basically everything surrounding the tables is vbCYAN which is what I'm trying to preserve.
I have attached links to what is my result vs. what I am after.
Bad (Table on bottom is cutoff and no blue to be found): http://i.imgur.com/RagFiU0.jpg
Good (Cyan all around is preserved): http://i.imgur.com/B4i843F.png
Code:
Sub Xlsx2PDF_EntirePageFormat
'Excel's Page Setup[INDENT]Dim File As String
Dim Path As String[/INDENT]
[INDENT] With ActiveSheet.PageSetup[/INDENT]
[INDENT] .PrintGridlines = True[/INDENT]
[INDENT] .Orientation = xlPortrait[/INDENT]
[INDENT] .PaperSize = xlPaperLetter[/INDENT]
[INDENT] .FirstPageNumber = xlAutomatic[/INDENT]
[INDENT] .Order = xlDownThenOver[/INDENT]
[INDENT] .BlackAndWhite = False[/INDENT]
[INDENT] .Zoom = False[/INDENT]
[INDENT] .FitToPagesWide = 1[/INDENT]
[INDENT] .FitToPagesTall = False[/INDENT]
[INDENT] .PrintErrors = xlPrintErrorsDisplayed[/INDENT]
[INDENT] End With
[/INDENT]
'Print 2 PDF Page Setup[INDENT] With ActiveWorkbook[/INDENT]
[INDENT] Path = "C:\Users\MyComp\Desktop\New folder\"[/INDENT]
[INDENT] For Each ws In .Worksheets[/INDENT]
[INDENT] File = ws.Range("B1").Value & ".pdf"[/INDENT]
[INDENT] ws.ExportAsFixedFormat Type:=xlTypePDF, _[/INDENT]
[INDENT] Filename:=Path & File, _[/INDENT]
[INDENT] Quality:=xlQualityStandard, _[/INDENT]
[INDENT] IncludeDocProperties:=False, _[/INDENT]
[INDENT] IgnorePrintAreas:=False, _[/INDENT]
[INDENT] OpenAfterPublish:=False[/INDENT]
[INDENT=2] Next ws
End With[/INDENT]
End Sub
In the code I have played with the:
zoom = 100 or False
.FitToPagesTall = 1 or False
etc and it makes no difference. It just seems to be only going for the Main work area and ignoring everything else at export time! If it's not too much trouble is there an easy code for "Page Breaks" to attach somewhere?? Any help is greatly appreciated, Thanks.