Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2
Default change header for each worksheet

How do I pull content from adjacent cells to print as header information in
multiple sheets?
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 524
Default change header for each worksheet

Tue, 29 Jan 2008 11:51:03 -0800 from cartmr
:
How do I pull content from adjacent cells to print as header
information in multiple sheets?


By "header information", do you mean the headers that are normally
edited with View | Header and Footer?

If so, as far as I understand things you need a macro. Here's the one
I use. You can modify it for the paticular cells you want. I
recommend named ranges like my "course" and "semester", rather than
cell references, just because it keeps the macro shorter.

Sub Workbook_Open()
Dim ws As Worksheet
Dim thisYear As Integer
thisYear = Evaluate("Year(FirstClass)")
For Each ws In Worksheets
ws.PageSetup.LeftHeader = Worksheets("Rules").Range("course").Value _
& "/" & Worksheets("Rules").Range("section").Value
ws.PageSetup.RightHeader = Worksheets("Rules").Range("semester").Value & " " & thisYear
Next
ActiveWorkbook.Saved = True
End Sub


This macro runs automatically when the workbook opens. The last
statement, ActiveWorkbook.Saved = True, ensures that I don't get the
"do you want to save?" prompt if I open the workbook but don't
actually change anything before closing it.


--
Stan Brown, Oak Road Systems, Tompkins County, New York, USA
http://OakRoadSystems.com/
"If there's one thing I know, it's men. I ought to: it's
been my life work." -- Marie Dressler, in /Dinner at Eight/
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
how do I change the lerrers in the header of each cell to a name? robush3 New Users to Excel 3 December 12th 07 12:18 AM
can you change the colors of a header in excel worksheet HJ Heinz Company Excel Discussion (Misc queries) 2 October 31st 07 03:36 PM
Excel -Cannot global Header change Rag742 Excel Discussion (Misc queries) 4 February 14th 07 10:05 PM
how do I put the day into my header with the date have it change d clyde Setting up and Configuration of Excel 3 July 30th 06 12:59 PM
Change Header data MrMountain Excel Discussion (Misc queries) 1 January 21st 06 08:25 PM


All times are GMT +1. The time now is 09:30 AM.

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"