View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Frank Kabel Frank Kabel is offline
external usenet poster
 
Posts: 3,885
Default custom Header-Automated

Hi Juan
if the region is in cell A1 and the period in cell B1 of your sheet try
the following macro. Put it in your workbook module (not in an standard
module):

Private Sub Workbook_BeforePrint(Cancel As Boolean)
Dim wkSht As Worksheet
Dim head_str
For Each wkSht In Me.Worksheets
head_str = wkSht.range("A1").value & _
" - REPORT NAME PERIOD " & _
wkSht.range("B1").value & ", 2004"
With wkSht.PageSetup
.CenterHeader = head_str
End With
end with
Next wkSht
End Sub



--
Regards
Frank Kabel
Frankfurt, Germany


juan wrote:
Hello,
I have a custome header Example,
(REGION) - REPORT NAME PERIOD X, 2004

So before I print, I have to fill in what region Example
NA, EUROPE Or ASIA, plus what period I'm doing.
Is it possible to use a macro to fill the region and
period instead of doing manually to the menu toolbar,
Format/header/footers?

Not sure if I'm clear.
Please advise any info.

Thank you,

Juan