Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
Is there a way (before I print the activeworkbook) to set the header of each worksheet in my workbook to the sheet's name plus the [page] number? There can be many sheets in the activeworkbook with different names.... and with many pages that print on each sheet (that's why I need the page number at the end of each sheet's name in the header). Any help on this would be greatly appreciated!! Thanks in advance Kimberly |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() "KimberlyC" wrote in message ... Hi Is there a way (before I print the activeworkbook) to set the header of each worksheet in my workbook to the sheet's name plus the [page] number? There can be many sheets in the activeworkbook with different names.... and with many pages that print on each sheet (that's why I need the page number at the end of each sheet's name in the header). Any help on this would be greatly appreciated!! Thanks in advance Kimberly try this: Sub title_pages() 'change month in center heading before running For i = 1 To Sheets.Count With Sheets(i).PageSetup .LeftHeader = "" .CenterHeader = _ "Company Name" & Chr(10) _ & "&A" & Chr(10) _ & Format(DateSerial(Year(Now), Month(Now) - 1, 1), "mmm-yyyy") .RightHeader = "" .LeftFooter = "" .CenterFooter = "Page &P of &N" .RightFooter = "" End With Next i End Sub |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Kimberly
Sub Name_in_Header() For i = 1 To Sheets.Count With Sheets(i).PageSetup .CenterHeader = Sheets(i).Name & " Page &P" End With Next i End Sub Gord Dibben Excel MVP On Wed, 11 May 2005 13:39:55 -0700, "KimberlyC" wrote: Hi Is there a way (before I print the activeworkbook) to set the header of each worksheet in my workbook to the sheet's name plus the [page] number? There can be many sheets in the activeworkbook with different names.... and with many pages that print on each sheet (that's why I need the page number at the end of each sheet's name in the header). Any help on this would be greatly appreciated!! Thanks in advance Kimberly |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thank you!!
They both work well!! "KimberlyC" wrote in message ... Hi Is there a way (before I print the activeworkbook) to set the header of each worksheet in my workbook to the sheet's name plus the [page] number? There can be many sheets in the activeworkbook with different names.... and with many pages that print on each sheet (that's why I need the page number at the end of each sheet's name in the header). Any help on this would be greatly appreciated!! Thanks in advance Kimberly |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Automatic Page Number and Sheet Names? | Excel Discussion (Misc queries) | |||
saving a sheet as a web page and retaining the headers and footer. | Excel Discussion (Misc queries) | |||
Numbering Headers/ | Excel Discussion (Misc queries) | |||
Setting Pivot Table Page Field Names using VBA | Excel Programming | |||
Setting Pivot Table Page Field Names using VBA | Excel Programming |