Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello,
I have about 6 sheets and each has a Page Header Example, Total Items - Period X, 2007 YTD, I'm trying to input an actual number in the X, Example, Total items - Period 12 2007 YTD. Its time consuming going manually into each sheet an replace the X with the current Period. Is there a way I can do this with a Macro? I really would appreciate any info I can get Thank you, J |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hey Juan,
By "Page Header" do you mean the Header/Footer section in the Page Setup? If so, try this: For Each Sh In ActiveWorkbook.Worksheets Msg = InputBox("What month?") Sh.PageSetup.CenterFooter = "Total Items - Period " & Msg & ", 2007 YTD" Next Sh On Jan 8, 4:28*pm, Juan wrote: Hello, I have about 6 sheets and each has a Page Header Example, Total Items - Period X, 2007 YTD, I'm trying to input an actual number in the X, Example, Total items - Period 12 2007 YTD. *Its time consuming going manually into each sheet an replace the X with the current Period. Is there a way I can do this with a Macro? * I really would appreciate any info I can get Thank you, J |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello JP,
thanks for the info. Yes I meant Header/Footer section. I did a quick test changing Footer to Header and seems your code will do just fine. So thanks alot for your help. Hope u had a great New Year. "JP" wrote: Hey Juan, By "Page Header" do you mean the Header/Footer section in the Page Setup? If so, try this: For Each Sh In ActiveWorkbook.Worksheets Msg = InputBox("What month?") Sh.PageSetup.CenterFooter = "Total Items - Period " & Msg & ", 2007 YTD" Next Sh On Jan 8, 4:28 pm, Juan wrote: Hello, I have about 6 sheets and each has a Page Header Example, Total Items - Period X, 2007 YTD, I'm trying to input an actual number in the X, Example, Total items - Period 12 2007 YTD. Its time consuming going manually into each sheet an replace the X with the current Period. Is there a way I can do this with a Macro? I really would appreciate any info I can get Thank you, J |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
What would be the source of "X"?
Assume it is in A1 of each sheet........... Sub Cell_In_AllHeaders() Dim ws As Worksheet For Each ws In ActiveWorkbook.Sheets ws.PageSetup.CenterHeader = "Total Items - Period " _ & ws.Range("A1").Value & " 2007 YTD" Next End Sub Gord Dibben MS Excel MVP On Tue, 8 Jan 2008 13:28:01 -0800, Juan wrote: Hello, I have about 6 sheets and each has a Page Header Example, Total Items - Period X, 2007 YTD, I'm trying to input an actual number in the X, Example, Total items - Period 12 2007 YTD. Its time consuming going manually into each sheet an replace the X with the current Period. Is there a way I can do this with a Macro? I really would appreciate any info I can get Thank you, J |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Omit header from first page without embedding header in code | Excel Worksheet Functions | |||
Get header only on first page of multi page excel file | Excel Discussion (Misc queries) | |||
header and footer on every page except the first page? | Excel Discussion (Misc queries) | |||
Page Header with Fit to 1 page wide | Excel Programming | |||
Header - only on first page | Excel Programming |