Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 45
Default cell reference in header

How can I put a value of a cell into the header?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,355
Default cell reference in header

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


"Dana" wrote:

How can I put a value of a cell into the header?

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 112
Default cell reference in header

Can it include more than 1 cell?

"Barb Reinhardt" wrote:

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


"Dana" wrote:

How can I put a value of a cell into the header?

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default cell reference in header

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

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



Mickey wrote:

Can it include more than 1 cell?

"Barb Reinhardt" wrote:

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


"Dana" wrote:

How can I put a value of a cell into the header?


--

Dave Peterson
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Maintaining cell reference after sorting GRITS Excel Discussion (Misc queries) 2 April 30th 23 07:42 PM
Loop Macro a variable number of times thesaxonuk Excel Discussion (Misc queries) 11 October 31st 06 06:05 PM
Help with this conditional IF statement C-Dawg Excel Discussion (Misc queries) 3 May 15th 06 06:01 PM
Getting contents of a cell when cell reference is in the sheet A Nelson Excel Discussion (Misc queries) 3 October 5th 05 06:46 PM
Input cell reference is not valid (One Variable Data Table) Dottore Excel Worksheet Functions 9 September 1st 05 03:05 PM


All times are GMT +1. The time now is 02:17 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"