Hello,
I have the following code running to set up the Print Area for a worksheet. Then it enters Page Breaks into the worksheet.
My problem is this:
When it sets the page break, the page width is too wide to fit onto one page. I've tried PageSetup.Zoom = 75 to scale down the data, but this then removes the PageSetup.FitToPagesTall = 1 setting - therefore making the page too tall to fit on one page. (I understand that the .Zoom and the .FitTo settings are mutually exclusive.) I can't set the FitToPagesWide as a set number, as my data's width will vary.
What I would ideally like is to set the Vertical Page Break, keeping the FitToPagesTall = 1, and then to set the Print Area for the page I just created to fit completely on one page. Then repeat this process until the end of my data.
I hope this problem is clear, and I greatly appreciate your assistance.
I have the following code running to set up the Print Area for a worksheet. Then it enters Page Breaks into the worksheet.
Code:
With Sheets("SummaryView")
.PageSetup.PrintArea = "$C$6:" & where.Offset(35, 0).Address
.PageSetup.FitToPagesWide = False
.PageSetup.FitToPagesTall = 1
End With
For i = xCol + 1 To where.Column Step xCol
Sheets("SummaryView").VPageBreaks.Add Before:=Sheets("SummaryView").Cells(1, i)
Next
My problem is this:
When it sets the page break, the page width is too wide to fit onto one page. I've tried PageSetup.Zoom = 75 to scale down the data, but this then removes the PageSetup.FitToPagesTall = 1 setting - therefore making the page too tall to fit on one page. (I understand that the .Zoom and the .FitTo settings are mutually exclusive.) I can't set the FitToPagesWide as a set number, as my data's width will vary.
What I would ideally like is to set the Vertical Page Break, keeping the FitToPagesTall = 1, and then to set the Print Area for the page I just created to fit completely on one page. Then repeat this process until the end of my data.
I hope this problem is clear, and I greatly appreciate your assistance.