View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
kevcar40 kevcar40 is offline
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