Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
kasaz
 
Posts: n/a
Default How can I include the name of the tab in a header without typing .

I have 4 large workbooks. I have to print all of the pages in each monthly.
I would like to add the names of the tabs in individual headers for each tab.
Is there a formula I can use that will pick this up, or will I have to type
each one manually?
  #2   Report Post  
Gord Dibben
 
Posts: n/a
Default

kasaz

Sub TabInFooter()
Dim ws As Worksheet
For Each ws In ActiveWorkbook.Sheets
ws.PageSetup.RightHeader = ws.Name
Next ws
End Sub

If not familiar with VBA and macros, see David McRitchie's site for more on
"getting started".

http://www.mvps.org/dmcritchie/excel/getstarted.htm

In the meantime..........

First...create a backup copy of your original workbook.

To create a General Module, hit ALT + F11 to open the Visual Basic Editor.

Hit CRTL + R to open Project Explorer.

Find your workbook/project and select it.

Right-click and InsertModule. Paste the code in there. Save the
workbook and hit ALT + Q to return to your workbook.

The macro can be assigned to a button or shortcut-key combo.

Could also be run as a Before_Print event.

Private Sub Workbook_BeforePrint(Cancel As Boolean)
Dim ws As Worksheet
For Each ws In ActiveWorkbook.Sheets
ws.PageSetup.RightHeader = ws.Name
Next ws
End Sub

This code would go into the ThisWorkbook module.


Gord Dibben Excel MVP


On Thu, 24 Feb 2005 11:45:02 -0800, "kasaz"
wrote:

I have 4 large workbooks. I have to print all of the pages in each monthly.
I would like to add the names of the tabs in individual headers for each tab.
Is there a formula I can use that will pick this up, or will I have to type
each one manually?


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
Header Problem ChrisA Excel Discussion (Misc queries) 0 February 17th 05 03:51 PM
Graphic in Header scaling with pages contents Shannon Broskie Excel Discussion (Misc queries) 0 February 15th 05 09:29 PM
header or footer ParTeeGolfer Excel Worksheet Functions 4 January 9th 05 07: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 06:12 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"