Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 53
Default Custom Header - poss to link to contents of cell?

Hi everyone,

Is it possible to use a cell reference in the custom header to pick up info
in a cell in the worksheet?

TIA
--
Smudge
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 78
Default Custom Header - poss to link to contents of cell?

hi
not sure exactly what you want but i use the following to copy the
contents of a cell into the headers and footers

Sub HeaderandFooter()
Dim s As Integer
For s = 1 To Worksheets.Count
Worksheets(s).PageSetup.CenterFooter = "&""Arial""&7" &
ThisWorkbook.Worksheets("sheet1").Range("E1").Valu e
Worksheets(s).PageSetup.LeftHeader = "&""Arial""&7" &
ThisWorkbook.Worksheets("sheet1").Range("B1").Valu e
' Worksheets(s).PageSetup.RightHeader = "&""Arial""&7" &
ThisWorkbook.Worksheets("sheet1").Range("C1").Valu e
Worksheets(s).PageSetup.LeftFooter = "&""Arial""&7" &
ThisWorkbook.Worksheets("sheet1").Range("D1").Valu e
Worksheets(s).PageSetup.RightFooter = "&""Arial""&7" &
ThisWorkbook.Worksheets("sheet1").Range("C1").Valu e
' Worksheets(s).PageSetup.CenterHeader = "&""Arial""&7" &
ThisWorkbook.Worksheets("sheet1").Range("F1").Valu e
Next s
End Sub
Paste the code into a macro, type some data into the cells
and test the results
HTH
kevin

On 18 Oct, 11:50, Smudge wrote:
Hi everyone,

Is it possible to use a cell reference in the custom header to pick up info
in a cell in the worksheet?

TIA
--
Smudge



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default Custom Header - poss to link to contents of cell?

Sub CellInFooter()
With ActiveSheet
.PageSetup.CenterFooter = .Range("A1").Value
End With
End Sub


Gord Dibben MS Excel MVP

On Thu, 18 Oct 2007 03:50:02 -0700, Smudge
wrote:

Hi everyone,

Is it possible to use a cell reference in the custom header to pick up info
in a cell in the worksheet?

TIA


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 53
Default Custom Header - poss to link to contents of cell?

Hi Kevcar,
Thanks for your reply but I'm obviously missing something as I can't get
this to work. Was I supposed to give the workshhet a particular name?

Cheers again
--
Smudge


"kevcar40" wrote:

hi
not sure exactly what you want but i use the following to copy the
contents of a cell into the headers and footers

Sub HeaderandFooter()
Dim s As Integer
For s = 1 To Worksheets.Count
Worksheets(s).PageSetup.CenterFooter = "&""Arial""&7" &
ThisWorkbook.Worksheets("sheet1").Range("E1").Valu e
Worksheets(s).PageSetup.LeftHeader = "&""Arial""&7" &
ThisWorkbook.Worksheets("sheet1").Range("B1").Valu e
' Worksheets(s).PageSetup.RightHeader = "&""Arial""&7" &
ThisWorkbook.Worksheets("sheet1").Range("C1").Valu e
Worksheets(s).PageSetup.LeftFooter = "&""Arial""&7" &
ThisWorkbook.Worksheets("sheet1").Range("D1").Valu e
Worksheets(s).PageSetup.RightFooter = "&""Arial""&7" &
ThisWorkbook.Worksheets("sheet1").Range("C1").Valu e
' Worksheets(s).PageSetup.CenterHeader = "&""Arial""&7" &
ThisWorkbook.Worksheets("sheet1").Range("F1").Valu e
Next s
End Sub
Paste the code into a macro, type some data into the cells
and test the results
HTH
kevin

On 18 Oct, 11:50, Smudge wrote:
Hi everyone,

Is it possible to use a cell reference in the custom header to pick up info
in a cell in the worksheet?

TIA
--
Smudge




  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 53
Default Custom Header - poss to link to contents of cell?

Thank you Gord

Cheers
--
Smudge


"Gord Dibben" wrote:

Sub CellInFooter()
With ActiveSheet
.PageSetup.CenterFooter = .Range("A1").Value
End With
End Sub


Gord Dibben MS Excel MVP

On Thu, 18 Oct 2007 03:50:02 -0700, Smudge
wrote:

Hi everyone,

Is it possible to use a cell reference in the custom header to pick up info
in a cell in the worksheet?

TIA





  #6   Report Post  
Posted to microsoft.public.excel.misc
DMC DMC is offline
external usenet poster
 
Posts: 3
Default Custom Header - poss to link to contents of cell?

Where is this typed into?..... the Header or some other place?
I tried putting it into the header and it returned what I typed.
Thanks,
Dennis

"Gord Dibben" wrote:

Sub CellInFooter()
With ActiveSheet
.PageSetup.CenterFooter = .Range("A1").Value
End With
End Sub


Gord Dibben MS Excel MVP

On Thu, 18 Oct 2007 03:50:02 -0700, Smudge
wrote:

Hi everyone,

Is it possible to use a cell reference in the custom header to pick up info
in a cell in the worksheet?

TIA



  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4,624
Default Custom Header - poss to link to contents of cell?

See

http://www.mvps.org/dmcritchie/excel/getstarted.htm


In article ,
DMc wrote:

Where is this typed into?..... the Header or some other place?
I tried putting it into the header and it returned what I typed.

  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default Custom Header - poss to link to contents of cell?

Since you're not familiar with VBA and macros, see David McRitchie's site for
more on "getting started".

http://www.mvps.org/dmcritchie/excel/getstarted.htm

Or Ron de Bruin's site for where to place code.

http://www.rondebruin.nl/code.htm

In the meantime..........

First...create a backup copy of your original workbook.

To create a General Module, hit ALT + F11 to open the Visual Basic Editor.

Hit CRTL + r to open Project Explorer.

Find your workbook/project and select it.

Right-click and InsertModule. Paste the code in there. Save the
workbook and hit ALT + Q to return to your workbook.

Run or edit the macro by going to ToolMacroMacros.

You can also assign this macro to a button or a shortcut key combo or stick it
in a BeforePrint event.


Gord

On Wed, 31 Oct 2007 07:59:01 -0700, DMc wrote:

Where is this typed into?..... the Header or some other place?
I tried putting it into the header and it returned what I typed.
Thanks,
Dennis

"Gord Dibben" wrote:

Sub CellInFooter()
With ActiveSheet
.PageSetup.CenterFooter = .Range("A1").Value
End With
End Sub


Gord Dibben MS Excel MVP

On Thu, 18 Oct 2007 03:50:02 -0700, Smudge
wrote:

Hi everyone,

Is it possible to use a cell reference in the custom header to pick up info
in a cell in the worksheet?

TIA




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
Link page header with cell contents Matthew Excel Worksheet Functions 8 May 1st 07 06:22 PM
Can I link a cell's contents to the header or footer in Excel? djoslyn Excel Discussion (Misc queries) 14 October 17th 06 11:03 PM
can I use a cell's contents as part of a custom header? NHVP Treasurer Excel Discussion (Misc queries) 1 February 12th 06 03:28 AM
Can you link a custom property to an Excel custom header text? LouErc Setting up and Configuration of Excel 0 November 8th 05 04:58 PM
excel - insert cell contents in a custom header / footer b Excel Discussion (Misc queries) 0 August 25th 05 06:51 PM


All times are GMT +1. The time now is 04:29 PM.

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"