Set print width to page width in VBA

  • Thread starter Thread starter Trevor Best
  • Start date Start date
T

Trevor Best

IF I set the width, e.g.

ActiveWorksheet.PageSetup..FitToPagesWide = 1

It automatically makes it 1 page tall, not good on long sheets, how do
I set it to scale 1 page wide and however many pages tall?
 
I recorded a macro when I did it manually. These are the lines that I'd keep:

With ActiveSheet.PageSetup
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = False
End With
 
Trevor,

Keep in mind that FitToPages proportionally (height and width) scrunches the
print until it gets to your 1-page-wide specification. This will result in
whatever height the shape of the worksheet provides. Excel limits the print
to either the width or the height limits you specify -- it doesn't
simultaneously re-shape the print to the height AND width your specify.

Earl Kiosterud
mvpearl omitthisword at verizon period net
 
Back
Top