Page Footer

LEXCERM

Active Member
Joined
Jun 26, 2004
Messages
320
Office Version
  1. 365
Platform
  1. Windows
Hi,

There are 4 lines of text that I wish to add at the foot of every page which is printed. The pages can vary in quantity as the data will be filtered using different criteria.

I cannot add the text in the Footer field as it exceeds 255 characters.

How can I add these 4 lines of text at the bottom of each page that is printed, bearing in mind that there will be differing amount of pages printed?

Thanks in advance for your help.

Paul.
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
Hi,

Not ideal but could the text go at the top of the page instead? If so you could use the Rows to repeat at top option from Page Setup.

Dom
 
Upvote 0
With code:
Code:
Private Sub Workbook_BeforePrint(Cancel As Boolean) 
    ActiveSheet.PageSetUp.LeftFooter ="First Line" & CHR(10) & "Second Line" & CHR(10) & "Third Line" & CHR(10) & "Fourth Line"
End Sub

This goes in the This WorkBook module. RightClick the Excel icon to the left of the word "File" on the menu bar and choose "View Code".

HTH
lenze
 
Upvote 0
Lenze,

Does that get round the 255 character limit?

Been looking at this myself recently for a work project and understood it couldn't be bypassed.

Dom
 
Upvote 0
Thanks for replying,

Have just tried the code but it errors:

1004
Unable to set the centre footer property of the Pages Setup class.

It must be the 255 character limit

Paul.
 
Upvote 0
The only way I can think of achieving this is to type the details and save it as a jpeg - then insert the graphic in the footer.

It works, but have to tweak it to get clear printing.

Paul.
 
Upvote 0
It may not get around the 255 character limit. I don't really know. Perhaps the solution is to break the footer up
Code:
Private Sub Workbook_BeforePrint(Cancel As Boolean) 
    With ActiveSheet.PageSetUp
            .LeftFooter ="First Line" & CHR(10) & "Second Line" 
            .RightFooter = "Third Line" & CHR(10) & "Fourth Line"
    End With
 
End Sub


lenze
 
Upvote 0

Forum statistics

Threads
1,214,583
Messages
6,120,375
Members
448,955
Latest member
BatCoder

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