View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
smartin smartin is offline
external usenet poster
 
Posts: 915
Default Linking cells to Headers and Footers

Gregory wrote:
I would like to have a worksheet (Master) which has the information
that I would like to have put into various headers in different
worksheets. I'd like to link the header elements of the different
worksheets to this Master so that when I want to change the name of a
company, exhibit number, etc., it automatically changes the header.
Is this possible?

Thanks in advance, Gregory


You can make headers & c. dynamic using VBA. This code will create a
header with whatever is in cell A1 of each worksheet:

Sub MakeHeaders()
Dim WKS As Worksheet

Application.ScreenUpdating = False
With ActiveSheet.PageSetup
For Each WKS In ActiveWorkbook.Worksheets
.LeftHeader = Range("A1").Text
Next WKS
End With
Application.ScreenUpdating = True
End Sub

To extend this, record a macro as you manually create an arbitrary
header. The code it creates will reveal a plethora of other page setup
options you can tweak in code.

To automate the process of updating the headers, place something in the
workbook before_print event that calls MakeHeaders.