cell reference in header

B

Barb Reinhardt

As I recall, I had to Macro to do this.

Try this:

Alt F11
Double click on THIS WORKBOOK.
Click on GENERAL and pull down to WORKBOOK.
On the right it shows OPEN. Change it to BeforePrint
Let's say you want what's in cell A1 to be displayed.
Enter this in for the macro

Private Sub Workbook_BeforePrint(Cancel As Boolean)

With ActiveSheet.PageSetup
.RightFooter = ""
.LeftFooter = ""
.CenterFooter = ""
.RightHeader = ""
.LeftHeader = ""
.CenterHeader = Range("A1").Value
End With

End Sub
 
M

Mickey

Can it include more than 1 cell?

Barb Reinhardt said:
As I recall, I had to Macro to do this.

Try this:

Alt F11
Double click on THIS WORKBOOK.
Click on GENERAL and pull down to WORKBOOK.
On the right it shows OPEN. Change it to BeforePrint
Let's say you want what's in cell A1 to be displayed.
Enter this in for the macro

Private Sub Workbook_BeforePrint(Cancel As Boolean)

With ActiveSheet.PageSetup
.RightFooter = ""
.LeftFooter = ""
.CenterFooter = ""
.RightHeader = ""
.LeftHeader = ""
.CenterHeader = Range("A1").Value
End With

End Sub
 
D

Dave Peterson

..CenterHeader = Range("A1").Value
could be

..CenterHeader = Range("A1").Value & vblf & range("b1".value & _
" " & format(range("c1").value, "mm/dd/yyyy")
 
Top