JackDanIce
Well-known Member
- Joined
- Feb 3, 2010
- Messages
- 9,922
- Office Version
- 365
- Platform
- Windows
Hi,
Having issues with printing areas in worksheets, so have the following (partial) code:
I would each sheet's print area to be the least number of A4 pages possible, optimised for landscape or portrait orientation.
I have one sheet where landscape orientation means 971 pages, but portrait cuts it to 455. I think I need to also adjust .FitToPagesWide and .FitToPagesTall, but have tried setting both to 1 (i.e. 1 page wide by 1 page tall), but this doesn't create the optimal print area.
Any suggestions?
TIA,
Jack
Having issues with printing areas in worksheets, so have the following (partial) code:
Code:
With Activesheet.PageSetup
.PaperSize = xlPaperA4
.Orientation = xlPortrait
x = (wks.HPageBreaks.Count + 1) * (wks.VPageBreaks.Count + 1)
.Orientation = xlLandscape
'Orientate the page for least number of page breaks
.Orientation = IIf(x < (wks.HPageBreaks.Count + 1) * (wks.VPageBreaks.Count + 1), xlPortrait, xlLandscape)
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = False
End With
I have one sheet where landscape orientation means 971 pages, but portrait cuts it to 455. I think I need to also adjust .FitToPagesWide and .FitToPagesTall, but have tried setting both to 1 (i.e. 1 page wide by 1 page tall), but this doesn't create the optimal print area.
Any suggestions?
TIA,
Jack