How can you format a date in the header/footer of Excel sheet

S

SAM SEBAIHI

When viewing a header/footer, I would like to insert a date in spcial format, how can I do this?


--------------------------------------------------------------------------------

Sam Sebaihi
Faculty
Western International University
Associate Programs
[email protected]
[email protected] (alternate email)
Phone #: (405)315-8223 Time zone: Pacific Time
 
G

Gord Dibben

Sam

Whatever format is in the Windows Regional and Language Settings governs what
the format is in the header or footer.

These are very limited and Excel recognizes only a few for header formatting.

To get a header date format of your choosing use a cell reference for the
header.

e.g. In A1 enter =TEXT(DATE(2006,12,10),"dddd, mmmm d"&", "&"yyyy")

Then run this macro.

Sub CellInHeader()
With ActiveSheet
.PageSetup.CenterHeader = Range("A1").Value
End With
End Sub


Gord Dibben MS Excel MVP
 
G

Gord Dibben

Sam

Added info.

Excel only recognizes the Windows Short Date setting for headers and footers.

Also..............

You can edit the macro for RightHeader or LeftFooter or wherever you want.

Gord

Sam

Whatever format is in the Windows Regional and Language Settings governs what
the format is in the header or footer.

These are very limited and Excel recognizes only a few for header formatting.

To get a header date format of your choosing use a cell reference for the
header.

e.g. In A1 enter =TEXT(DATE(2006,12,10),"dddd, mmmm d"&", "&"yyyy")

Then run this macro.

Sub CellInHeader()
With ActiveSheet
.PageSetup.CenterHeader = Range("A1").Value
End With
End Sub


Gord Dibben MS Excel MVP

Gord Dibben MS Excel MVP
 
G

Gord Dibben

Thanks for the feedback Sam

If you decided to go with this and need a changing date just alter the A1

formula to =TEXT(TODAY(),"dddd, mmmm d"&", "&"yyyy")


Gord

Thank you so much Gord. I do appreciate your help through out this
newsgroup.

Gord Dibben MS Excel MVP
 
Top