Page Setup Property

Kavy

Well-known Member
Joined
Jun 25, 2007
Messages
607
Hello all, I am specify that my worksheet, when it prints fits to 1 pages wide

ws.pagesetup.fittopageswide = 1

but for some reason it also fits to only one page long, I want it to fit to as many pages long as need be, anyone know anything about this?
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.

Atroxell

Active Member
Joined
Apr 18, 2007
Messages
422
try adding
Code:
        ws.pagesetup.FitToPagesWide = 1
        ws.pagesetup.FitToPagesTall = False
 

Richard Schollar

MrExcel MVP
Joined
Apr 19, 2005
Messages
23,707
Hi

Try the following modification:

Code:
With ws.PageSetup
   .Zoom = False
   .FitToPagesTall = False
   .FitToPagesWide = 1
End With
 

Kavy

Well-known Member
Joined
Jun 25, 2007
Messages
607
thanks all, didn't know i could set the FitToPagesTall to False!!

I new about the Zoom thing though, but why do you need to turn it off?
Not that important, just if anyone has a sec!
 

Richard Schollar

MrExcel MVP
Joined
Apr 19, 2005
Messages
23,707
If Zoom is not set to False, then FitToPagesWide and FitToPagesTall settings are ignored - I found this out the hard way on a little project I created for someone at work. It is documented in the VBA Help in Excel, but it doesn't seem (to me at least) intuitive...
 

Forum statistics

Threads
1,181,607
Messages
5,930,871
Members
436,764
Latest member
avalladarez

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top