Headers and Footers

  • Thread starter Thread starter Beccy
  • Start date Start date
B

Beccy

I have a workbook with 30 different sheets in it. I would
like to set up a footer on each of the sheets to say the
same thing. Is there a way of doing this without having to
go into each sheet and set the footer up 30 times?

Any help appreciated
Thanks
 
Hi Beccy
just select all tabs with your mouse and goto 'Pagesetup'. Your entries
will affect all selected sheets
Frank
 
Beccy,

In ThisWorkbook code module, add this code

Private Sub Workbook_BeforePrint(Cancel As Boolean)
With ActiveSheet
.PageSetup.LeftFooter = "Hello"
End With
End Sub

just change the code to suit.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
Select all sheets first Beccy
Then add the footer

Don't forget to ungroup the sheets
 
This makes all the other page setup functions change on
the sheets too. Like if on the original page the setup is
landscape, then it changes all the other sheets to
landscape too. I just want it to change the footer?
 
I don't know what this means?
-----Original Message-----
Beccy,

In ThisWorkbook code module, add this code

Private Sub Workbook_BeforePrint(Cancel As Boolean)
With ActiveSheet
.PageSetup.LeftFooter = "Hello"
End With
End Sub

just change the code to suit.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)




.
 
then you have to use VBA which selects all your sheets and changes the
footer
Example:
Put the following code in a module of your workbook
Public Sub Change_footer()
Dim wkSht As Worksheet
For Each wkSht In ActiveWindow.SelectedSheets
With wkSht.PageSetup
.CenterFooter = "Your text"
End With
Next wkSht
End Sub

change your format accrodingly. Select all sheets and invoke this macro

Frank
 
Beccy,

Go into the VBE (Alt-F11), select your workbook from the list in the
top-left window, select ThisWorkbook within that, double-click ThisWorkbook,
and post the code into the window that opens up.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
Back
Top