Can't print only 1 page wide-what am I doing wrong?

E

Ed from AZ

I am using the following code to print out a worksheet on a landscaped
page. I want all the columns to fit across the width of one page;
rows can slip onto the next page. In my code, I set FitToPagesWide =
1, but it doesn't do what I think it should.

What am I dong wrong?

Ed


' Prints Sheet2 list
Set rngWork = wks2.UsedRange
With wks2.PageSetup
.Orientation = xlLandscape
.TopMargin = Application.InchesToPoints(1)
.BottomMargin = Application.InchesToPoints(1)
.LeftMargin = Application.InchesToPoints(0.5)
.RightMargin = Application.InchesToPoints(0.5)
.PrintArea = rngWork.Address
.FitToPagesWide = 1
.CenterHeader = "&D"
.CenterFooter = "Page &P of &N"
.PrintTitleRows = wks2.Rows(1).Address
End With

wks2.PrintOut
 
J

JE McGimpsey

From XL/VBA Help ("FitToPagesWide" topic):

If the Zoom property is True, the FitToPagesWide
property is ignored.


So set

.Zoom = False
 
T

Tom Ogilvy

You should have all these commands:

.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = False
 
E

Ed from AZ

Thanks to both of you. I originally had Zoom = False, just before the
FitToPagesWide setting, but I thought the Help instructions meant that
if either of the FitToPages settings was active, then Zoom was
automatically false, and setting Zoom to a percentage would override
the FitToPages settings. Thanks for setting me straight.

Ed
 

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

Similar Threads

Print area - selection 4
Slow PageSetup macro 3
Printing Setup help 9
Help with PageSetup for printing, please? 2
Slow Macro - Formatting Macro 1
Print Setup Not Set 1
Page setup too slow 2
Define a Variable 1

Top