named cell referenced in header

  • Thread starter Thread starter Dave
  • Start date Start date
D

Dave

I would like to have a cell (company_name) on the first
worksheet be referenced within all the headers in the
workbook. How do I do this?
 
Using code, you would paste this in a workbook module:


Code:
--------------------

Sub setHeader()

Dim mySht As Variant
Dim i As Integer

For Each mySht In Worksheets
mySht.PageSetup.LeftHeader = _
Format(Worksheets("SetUp").Range("A1").Value)
Next

End Sub
--------------------


When run what this will do is paste whatever value is on a sheet named
"Setup" in cell A1 to the left header of all the sheets in the
workbook...I can't quite remember if it is possible to go to the page
setup and reference a cell there manually....

Hope this helps,

Dave M.
 
Dave M.
Thanks for the help.
But, I'm getting a "subscript out of range" error.
Plus, what is the i integer for?

Thanks,
Dave
 
Back
Top