Headers and footers

  • Thread starter Thread starter Jack Schitt
  • Start date Start date
J

Jack Schitt

Hi all

How do you enter a formula into a header or footer?
Even one as simple as "=CellRef" to return the value in the Cell referenced
would be a help
 
Instead of entering the formula in the header/footer, use an event macrl:

Put something like this in the ThisWorkbook code module:


Private Sub Workbook_BeforePrint(Cancel As Boolean)
Dim wsSheet As Worksheet
For Each wsSheet In ActiveWindow.SelectedSheets
With wsSheet
If .Name = "Sheet1" Then _
.PageSetup.CenterFooter = .Range("A1").Text
End With
Next wsSheet
End Sub

Modify the sheet name and range reference to suit.

If you're unfamiliar with macros, see David McRitchie's "Getting Started
with Macros":

http://www.mvps.org/dmcritchie/excel/getstarted.htm
 

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