Creating a header/footer with a link to spreadsheet data

G

Guest

I would like to create a footer that displays the version
number of the document. This information is located in
the file on a worksheet of its own. I would like to
choose a particular cell in that worksheet and have the
value appear in the footer.

Does anyone know how to make this happen.
 
D

Dave Peterson

You can use a workbook event that adjusts the header/footer.

Rightclick on the excel icon that is to the left of File (as in File|open)
Select view code
paste this in your code window:

Option Explicit
Private Sub Workbook_BeforePrint(Cancel As Boolean)

Dim wks As Worksheet

For Each wks In Me.Worksheets
wks.PageSetup.LeftFooter = "My note from: " _
& Me.Worksheets("sheet99").Range("a1").Value
Next wks

End Sub

It puts the value from A1 in sheet99 in the leftfooter on each sheet right
before it prints.
 
Top