Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8
Default Header and Footer

Can someone help me in regards to the Header in an excel workbook. I have a
workbook that has 10 worksheets (10 different branches). I would like the
header on all of them to read something like this Statistic Reports for
"branch" I would like the branch to be automatically inserted and then I also
have a summary sheet I would like all of the branch names to be included in
this sheet. Can someone please help or tell me a code I could use
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,203
Default Header and Footer

Where is this branch name supposed to come from? Sheet tab name? A cell on
the sheet? Or is that part of the question you're asking?

The Custom header/footer dialog has an icon to automatically insert the name
on the sheet's tab into the header, so that's probably the easiest answer for
the various sheet's headers.

The answer for automatically coming up with division names is almost not
automatic - when you see the formula I think you'll understand why. But as
with the answer to the first half, it depends on the sheet's names being the
Division names. Here's a formula that will give you the tab text (sheet
name) from Sheet1:

=RIGHT(CELL("filename",Sheet1!A1),LEN(CELL("filena me",Sheet1!A1))-FIND("]",CELL("filename",Sheet1!A1)))

You'll notice the name of the sheet you're looking for is typed 3 times in
the formula itself. But this code, put on the "table of contents" sheet will
place the names of all the other sheets in the workbook on it beginning at
A1. The code runs when that sheet is selected (Activated):
Private Sub Worksheet_Activate()
Dim AnySheet As Worksheet
Dim RowOffset As Integer

For Each AnySheet In Worksheets
If AnySheet.Name < ActiveSheet.Name Then
Range("A1").Offset(RowOffset, 0) = AnySheet.Name
RowOffset = RowOffset + 1
End If
Next

End Sub

This page gives the gory details of how to insert code attached to a
worksheet event: http://www.jlathamsite.com/Teach/WorksheetCode.htm in case
you need that information.


"Need Help" wrote:

Can someone help me in regards to the Header in an excel workbook. I have a
workbook that has 10 worksheets (10 different branches). I would like the
header on all of them to read something like this Statistic Reports for
"branch" I would like the branch to be automatically inserted and then I also
have a summary sheet I would like all of the branch names to be included in
this sheet. Can someone please help or tell me a code I could use

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 delete the drop down list of header / footer options in e Progress Finance Excel Discussion (Misc queries) 1 December 1st 05 06:49 PM
header and footer problems cliffhanger79 Charts and Charting in Excel 4 November 7th 05 08:03 PM
Header & Footer Excel 2003 juliasl0 Excel Discussion (Misc queries) 2 November 4th 05 02:37 PM
Give multiple charts on a worksheet/workbook same header or footer Ches Charts and Charting in Excel 2 July 4th 05 04:58 PM
How to insert a picture in the Footer (not the Header) in Excel 20 jmon Excel Worksheet Functions 2 March 17th 05 05:59 AM


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