Changing footers on all worksheets without changing print set up

G

Guest

How do I change all the footers in a workbook without changing the page set
up? When I try to change via view header/footer it still changes the page
lay out on all the worksheets!
 
G

Guest

A little macro should be able to handle that for you:

Sub CreateFooters()
'
Dim anySheet As Worksheet
For Each anySheet In Worksheets
With anySheet.PageSetup
.LeftFooter = "Left Part of Footer"
.CenterFooter = "Center Portion of footer"
.RightFooter = "Right part of footer"
End With
Next
End Sub

change the text to whatever you need it to be. If you have special stuff to
put in such as dates, page numbers, etc. Record a macro while doing it to
one sheet and look at how Excel set up that section and copy it into the code
above.

To put this code into action: Open the workbook. Press [Alt]+[F11] to open
the VB Editor, choose Insert | Module in the VB Editor and copy and paste
that code into it. Modify the code as needed for your footer setup.
 

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