PageSetup print settings not working

mikeymay

Well-known Member
Joined
Jan 17, 2006
Messages
1,644
Office Version
  1. 365
Platform
  1. Windows
I am using the following to set up a worksheet to print 1 page wide and then however many long to print the range
Code:
        With ActiveSheet.PageSetup
            .PrintArea = rngPrintRange
            .PrintTitleRows = "$13:$14"
            .LeftMargin = Application.InchesToPoints(0.393700787401575)
            .RightMargin = Application.InchesToPoints(0.393700787401575)
            .TopMargin = Application.InchesToPoints(0.590551181102362)
            .BottomMargin = Application.InchesToPoints(0.590551181102362)
            .HeaderMargin = Application.InchesToPoints(0.511811023622047)
            .FooterMargin = Application.InchesToPoints(0.511811023622047)
            .PrintGridlines = False
            .Orientation = xlLandscape
            .FitToPagesWide = 1
            .FitToPagesTall = False
        End With
When this is executed it still retains print the page over 4 sheets wide (i can still see the page breaks on the worksheets after executing the code) and doesn't seem to print the above setting unless I set them manually.
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
Oooo....what does that do? I didn't see it when I recorded the macro I stole from.....

I would have thought the .FitToPages command would do what I expect this to do.


Thanks
 
Upvote 0

Forum statistics

Threads
1,224,551
Messages
6,179,476
Members
452,915
Latest member
hannnahheileen

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
Back
Top