Can you reference cell values in Headers and Footers in Excel 200.

J

jkyte

I want to customize my Header on an Excel spreadsheet to include the value
conatined in certain cells on my worksheet such that I will not have to
change the header every time I change the value of the referenced cell. Does
anyone know how to do this?
 
F

Frank Kabel

Hi
only possible with VBA using an event procedure. e.g. put the following
code
in your workbook module for cell A1
Private Sub Workbook_BeforePrint(Cancel As Boolean)
Dim wkSht As Worksheet
For Each wkSht In Me.Worksheets
With wkSht.PageSetup
.CenterFooter = wksht.range("A1").value
End With
Next wkSht
End Sub
 
J

jkyte

Thanks

Frank Kabel said:
Hi
only possible with VBA using an event procedure. e.g. put the following
code
in your workbook module for cell A1
Private Sub Workbook_BeforePrint(Cancel As Boolean)
Dim wkSht As Worksheet
For Each wkSht In Me.Worksheets
With wkSht.PageSetup
.CenterFooter = wksht.range("A1").value
End With
Next wkSht
End Sub
 
Top