Set print width to page width in VBA

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?
 
D

Dave Peterson

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
 
E

Earl Kiosterud

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top