View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default How to create a "Field-like" Header?

You could use a macro to retrieve a value right before you print/print preview.

This goes behind the ThisWorkbook module:

Option Explicit
Private Sub Workbook_BeforePrint(Cancel As Boolean)
With Worksheets("sheet1").PageSetup
.LeftHeader = "a little stuff"
.CenterHeader = "what you want here"
.RightHeader = .range("a99").text
End With
End Sub

You can read more about events at:
Chip Pearson's site:
http://www.cpearson.com/excel/events.htm

David McRitchie's site:
http://www.mvps.org/dmcritchie/excel/event.htm

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm


Ed wrote:

Hi, Is it possible to set up a Header in which I can have something like a
"Field" that get's its data from some part of the worksheet, maybe with some
sort of Lookup or something?


--

Dave Peterson