Thread: Month formula
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Month formula

You could have a dedicated macro that you run once a month to update the
header--or you could change the header each time you open the file (or even each
time you print the file).

This changes the header each time the workbook is opened--whether it needs it or
not:

Option Explicit
Sub Auto_Open()

Dim wks As Worksheet

Set wks = Worksheets("Sheet1")

With wks.PageSetup
.CenterHeader = Format(Date, "mmmm")
End With
End Sub

I'd record a macro that formatted that header the exact way that I want it. Use
XXXXX as the month name and replace "XXXXX" in the recorded code with
Format(date,"mmmm").

If you need help post back with your current code.

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm


Dar wrote:

Is it possible to have a Month formula in a custom header, so that as the new
month begins, the header will display the Name of the Month.
Example, =Text(Today(),"mmmm") will show December right now in a cell, and
when January arrives, will show January.
But I want somehow to have the Month show up in the header, since others
will be using the worksheet and don't want to have to change the header
themselves.


--

Dave Peterson