Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Ed Ed is offline
external usenet poster
 
Posts: 279
Default How to create a "Field-like" Header?

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?


  #2   Report Post  
Posted to microsoft.public.excel.misc
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
  #3   Report Post  
Posted to microsoft.public.excel.misc
Ed Ed is offline
external usenet poster
 
Posts: 279
Default How to create a "Field-like" Header?

Thank you very much!

"Dave Peterson" wrote:

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

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
Want link my header to a cell value astrange Excel Discussion (Misc queries) 3 April 22nd 06 07:23 PM
Header Rows and Sort Issue MikeL. Excel Discussion (Misc queries) 1 March 28th 06 12:23 AM
Title Block as a header? mae1778 Excel Discussion (Misc queries) 2 August 18th 05 05:33 PM
how do I permanetly add custom header to excel header list? GARY Excel Discussion (Misc queries) 1 December 15th 04 08:52 PM
Default header in Excel under page set-up Melanie Excel Discussion (Misc queries) 2 December 15th 04 01:37 AM


All times are GMT +1. The time now is 09:35 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"