ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Footers after the fact (https://www.excelbanter.com/excel-programming/377920-footers-after-fact.html)

SmartyPants

Footers after the fact
 
In there any way to add footers en mass?

I have a rather large and complicated workbook and I would like to add
footers to everything that prints from the workbook.

Is there any code that will add a footer (picture) to anything that
prints from a workbook?

Adding footers to all charts and graphs will take me a couple hours.


Sandy

Footers after the fact
 
Here you go just add this to a standard module:

Sub AddFooters()
Dim ws As Worksheet
For Each ws In Worksheets
With ws.PageSetup
.LeftFooter = "My Left Footer"
.CenterFooter = "My Center Footer"
.RightFooter = "My Right Footer"
End With
Next
End Sub

Open VBE (Alt +F11)
Insert---Module
Paste Code
Run MAcro "AddFooters"


Sandy

SmartyPants wrote:
In there any way to add footers en mass?

I have a rather large and complicated workbook and I would like to add
footers to everything that prints from the workbook.

Is there any code that will add a footer (picture) to anything that
prints from a workbook?

Adding footers to all charts and graphs will take me a couple hours.



WhytheQ

Footers after the fact
 
maybe you can play around with the below to suit your needs:

Sub xxx()

Dim mySheet As Worksheet
For Each mySheet In ActiveWorkbook.Worksheets
With mySheet.PageSetup
.LeftFooterPicture.Filename = "C:\Sunset.jpg"
.LeftFooter = "&G"
End With
Next mySheet

Dim myChart As Chart
For Each myChart In ActiveWorkbook.Charts
With myChart.PageSetup
.LeftFooterPicture.Filename = "C:\Sunset.jpg"
.LeftFooter = "&G"
End With
Next myChart

End Sub

Rgds
J



On Nov 22, 1:39 pm, "SmartyPants" wrote:
In there any way to add footers en mass?

I have a rather large and complicated workbook and I would like to add
footers to everything that prints from the workbook.

Is there any code that will add a footer (picture) to anything that
prints from a workbook?

Adding footers to all charts and graphs will take me a couple hours.



Tom Ogilvy

Footers after the fact
 

You can use the beforeprint event to have your code add the footers.

To get the code, turn on the macro recorder while you do it manually.

Then open the beforeclose event and put similar code there.

http://www.cpearson.com/excel/events.htm for an overview of event code if
you are not familiar with it.

--
Regards,
Tom Ogilvy

"SmartyPants" wrote:

In there any way to add footers en mass?

I have a rather large and complicated workbook and I would like to add
footers to everything that prints from the workbook.

Is there any code that will add a footer (picture) to anything that
prints from a workbook?

Adding footers to all charts and graphs will take me a couple hours.




All times are GMT +1. The time now is 08:39 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com