Reference Excel cell in Page Header


Posted by Erica Botha on August 26, 1999 1:36 AM

Is it possible to setup the Page Header of a sheet to reflect the value of a cell in sheet1? Ie. Report has 30+ pages and gets created for 270 dealers. I want to show the dealer name (on sheet1) on each page's page header.

Posted by Ivan Moala on August 26, 1999 5:08 AM

Yes depending on your specifics ie weather your
page setup is the same for every sheet and the ref
name is in the same cell for each sheet then
you could try something like;

With ActiveSheet.PageSetup
.CenterHeader = MyName
etc......
End with

where MyName is the reference name
or
With ActiveSheet.PageSetup
.CenterHeader = ThisSheet.Range("A1")
etc......
End with

where range("A1") contains your dealer name.


Ivan



Posted by Chris on August 26, 1999 10:10 AM

If you are not going to be printing from a macro, if you use the following macro name, the macro will run each time you go to print.

Sub Workbook_BeforePrint()

Use Ivan's code here

End Sub

Chris