Footers after the fact

  • Thread starter Thread starter SmartyPants
  • Start date Start date
S

SmartyPants

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.
 
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
 
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
 
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top