View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.misc
Gord Dibben Gord Dibben is offline
external usenet poster
 
Posts: 22,906
Default Cell values in custom headers

Must be done programatically via VBA.

Sub CellInHeader()
With ActiveSheet
.PageSetup.CenterHeader = .Range("A1").Value
End With
End Sub

Or use a BeforePrint rountine.

Private Sub Workbook_BeforePrint(Cancel As Boolean)
With ActiveSheet
.PageSetup.CenterHeader = .Range("A1").Value
End With
End Sub

First macro goes into a General module.

Second goes into the Thisworkbook module.


Gord Dibben MS Excel MVP


On Fri, 11 Aug 2006 12:16:01 -0700, davidd
wrote:

How can I make a cell value appear in the custom header. I want a date in the
worksheet field A2 to appear in the header. I've tried several ways and cant
get it to appear. Any suggestions would be greatly appreciated!