Way to insert a footer in an entire workbook w/o altering headers

D

Deb

Everytime I select each tab and insert a picture for a footer, it messes up
the headers that are already established. Any suggestions?
 
P

PJFry

Sure. You need to open your VBA editor (Alt+F11) and create a new module.
You can do that by going to the Tool Bar and selecting Insert => Module.

Once you are in the new Module, paste in this code:

Sub addFooter()
Dim ws As Worksheet

For Each ws In Worksheets
ws.PageSetup.CenterFooter = "&P of &N"
Next

End Sub

This particular code puts the Page # of Pages code in the middle.

What were you looking to add?
 
P

PJFry

I just saw the note about adding a picture. Here is the code for that:

Sub addFooter
Dim ws As Worksheet

ActiveSheet.PageSetup.CenterFooterPicture.Filename = _
"File path and name here"
For Each ws In Worksheets
ws.PageSetup.CenterFooter = "&G"
Next

End Sub
 

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

Top