header/footer link to cell?

  • Thread starter Thread starter Suzanne
  • Start date Start date
S

Suzanne

Is there a way to link the header and/or footer to a
specific cell so that it will automatically update?

Thanks
Suzanne
 
Hi
you'll need VBA for this. Put the following
code in your workbook module (not in a standard module):
Private Sub Workbook BeforePrint(Cancel As Boolean)
Dim wkSht As Worksheet
For Each wkSht In me.Worksheets
With wkSht.PageSetup
.CenterFooter = .range("A1").value
End With
Next wkSht
End Sub

this links cell A1 of each sheet to the footer
 
Ok, this may be a little advanced for me, what is VBA?
and is there a basic site you can suggest for intro to
VBA? Also, with this VBA function will it automatically
place it on my chart worksheets? And if I need a header
do I change your formula to .centerheader=.range
("A1").value ?
 
Hi
for getting started with VBA see:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

As this is an event procedure also see:
http://www.cpearson.com/excel/events.htm

Currently this won't work for charts. If you want to include them use
Private Sub Workbook BeforePrint(Cancel As Boolean)
Dim wkSht
For Each wkSht In me.Sheets
With wkSht.PageSetup
.CenterFooter = .range("A1").value
End With
Next wkSht
End Sub

to also cycle through chart sheets

And yes you could use .centerheader
 
Back
Top