vba Header and Footer size when scaling pages

dantheman9

Board Regular
Joined
Feb 5, 2011
Messages
175
I'm using the following code to auto scale pages for printing to stop tables overlaping on to other pages;

Code:
With ActiveSheet.PageSetup
        .LeftHeader = "&G"
        .CenterHeader = "&""Bold""&14&U" & eventname & Chr(10) & eventname1 & Chr(10) & Chr(10) & "&G"
        .RightHeader = "&G"
        .PrintHeadings = False
        .PrintGridlines = False
        .PrintComments = xlPrintNoComments
        .CenterHorizontally = True
        .CenterVertically = False
        .Orientation = xlPortrait
        .Draft = False
        .PaperSize = xlPaperA4
        .FirstPageNumber = xlAutomatic
        .Order = xlDownThenOver
        .BlackAndWhite = False
        .Zoom = False
        .FitToPagesWide = 1
        .FitToPagesTall = False

All works ok, but the zooming in to fit to one page wide also edits the size of the Header, is there any way to keep the header size as is and only reduce the size of the content within the each page?

I have changing the Zoom option but with no effect, can't think of any other way to do it!
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
...sorry its ok found and options to not sacle the header with the page!

Code:
.ScaleDocWithHeaderFooter = True/False
 
Upvote 0

Forum statistics

Threads
1,224,521
Messages
6,179,291
Members
452,902
Latest member
Knuddeluff

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