Archive of Mr Excel Message Board


Back to Excel VBA archive index
Back to archive home

.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.


Check out our Excel VBA Resources

Re: .fittopages wide & .fittopagestall commands

Posted by ml on March 08, 2001 10:12 AM
you'll want:

.Zoom = False

prior to the FitToPages lines


Thanks ml.

Posted by Beginner Bob on March 08, 2001 2:18 PM
I knew it had to be something really simple. Thanks again.


This archive is from the original message board at www.MrExcel.com.
All contents © 1998-2004 MrExcel.com.
Visit our online store to buy searchable CD's with thousands of VBA and Excel answers.
Microsoft Excel is a registered trademark of the Microsoft Corporation.
MrExcel is a registered trademark of Tickling Keys, Inc.