MrExcel Publishing
Your One Stop for Excel Tips & Solutions

.fittopages wide & .fittopagestall commands


Posted by Beginner Bob on March 07, 2001 3:39 PM

A small problem here. I am adding sheets to my workbook with a macro, and I can't get the .fittopages wide & .fittopagestall commands to work. I have a bunch of other things in the 'With ActiveSheet.PageSetup' section that work just fine, but can't get this to work. Here's a section of my code:

ActiveSheet.PageSetup.PrintArea = "$A:$P"
With ActiveSheet.PageSetup
.CenterHeader = "&14CURRENT VENDOR BALANCES" & Chr(10) & "AS OF &D"
.LeftMargin = Application.InchesToPoints(0.25)
.RightMargin = Application.InchesToPoints(0.25)
.TopMargin = Application.InchesToPoints(1)
.BottomMargin = Application.InchesToPoints(1)
.HeaderMargin = Application.InchesToPoints(0.5)
.FooterMargin = Application.InchesToPoints(0.5)
.Orientation = xlLandscape
.CenterHorizontally = True
.FitToPagesWide = 1
.FitToPagesTall = 1
End With

Can someone help me with this please. Thanks in advance.


Posted by ml on March 08, 2001 10:12 AM

you'll want:

.Zoom = False

prior to the FitToPages lines

Posted by Beginner Bob on March 08, 2001 2:18 PM

Thanks ml.

I knew it had to be something really simple. Thanks again.