Formatting a Header

  • Thread starter Thread starter CC
  • Start date Start date
C

CC

Is there a way in which to format a custom header - I
would like to include the title of the tab in the center
section as well as the date - but the date to be formatted
as Month - Year. Ex. if 01/14/04 = January 2004. Thanks
in advance for your assistance.
 
to be a lot more specific- we are trying to "automate" it
Currently we have &[Date] function and we are trying to
format the results to MMMM-YYYY. Thanks CC
 
You could run a macro:

Option Explicit
Sub testme02()
With worksheets("sheet1").PageSetup
.CenterHeader = Format(Date, "mmmm-yyyy")
End With
End Sub

But you'll need to run this every day--keep it in a general module and name it
auto_open.

or maybe add it to the worbook_beforeprint event.

Option Explicit
Private Sub Workbook_BeforePrint(Cancel As Boolean)
With Worksheets("sheet1").PageSetup
.CenterHeader = Format(Date, "mmmm-yyyy")
End With
End Sub

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm
to be a lot more specific- we are trying to "automate" it
Currently we have &[Date] function and we are trying to
format the results to MMMM-YYYY. Thanks CC
-----Original Message-----
Is there a way in which to format a custom header - I
would like to include the title of the tab in the center
section as well as the date - but the date to be formatted
as Month - Year. Ex. if 01/14/04 = January 2004. Thanks
in advance for your assistance.
.
 
Back
Top