Header Date

  • Thread starter Thread starter Carol
  • Start date Start date
C

Carol

I selected the calendar icon to customize the header on a
worksheet. However, the date that shows on my worksheet
is incorrect even though the calendar is correct. It is
November 5, 2003, and the date is showing 05/11/2003 on my
document. If I change the date on the calendar to be May
5, 2003, then it shows 11-5-2003! It transposes it! Is
there a way to reformat the way a date is displayed in a
header? I haven't found one. Everything I've found is
for the default settings for dates in the cells.

Thank you.
 
Carol

First, I assume you meant May 11, 2003 not May 5, 2003.
If I change the date on the calendar to be May 5, 2003, then it shows 11-5-2003!

Second, the default short date format is set in Windows, not in Excel.

Start>Settings>Control Panel>Regional Settings(or Language
options)>Customize>Date

Gord Dibben XL2002
 
I have the short date set in Windows to '6/Nov/2003'. MS-Access query
headers print '6/Nov/2003' correctly, Excel ('97 and 2003) headers do
not: they print '6/11/2003' regardless of the Windows (XP) setting.
Any clues appreciated!

Peter Crossing
 
It sure looks like you'll need a macro.

Right click on the Excel Icon to the left of the worksheet menubar
(File|edit|View...) and select view code:

Paste this in:

Option Explicit

Private Sub Workbook_BeforePrint(Cancel As Boolean)
With Worksheets("sheet1").PageSetup
.LeftHeader = Format(Date, "d/mmm/yyyy")
End With
End Sub

Adjust the worksheet name & header section accordingly.
 
Back
Top