PC Review


Reply
Thread Tools Rate Thread

How change Date format in header?

 
 
Steve Adams
Guest
Posts: n/a
 
      9th Sep 2004
How can I get the date in my header to display: "September 9, 2004"

instead of "9/9/2004"


right now the custom header is: &[Date]




--
Thanks,
Steve (office 2000)


 
Reply With Quote
 
 
 
 
Dave Peterson
Guest
Posts: n/a
 
      9th Sep 2004
You'll have to use a little VBA.

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

Rightclick on the excel logo to the left of File (on the worksheet menubar) and
select view code.

Paste that code into the code window.

Adjust the worksheet name and .leftheader to what you want.

If you record a macro when you change the header, you'll see the syntax.

Steve Adams wrote:
>
> How can I get the date in my header to display: "September 9, 2004"
>
> instead of "9/9/2004"
>
> right now the custom header is: &[Date]
>
> --
> Thanks,
> Steve (office 2000)


--

Dave Peterson
(E-Mail Removed)
 
Reply With Quote
 
Steve Adams
Guest
Posts: n/a
 
      9th Sep 2004
That works really neat, Dave. VBA is good stuff!

--
Thanks,
Steve


"Dave Peterson" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> You'll have to use a little VBA.
>
> Option Explicit
> Private Sub Workbook_BeforePrint(Cancel As Boolean)
> Worksheets("sheet1").PageSetup.LeftHeader = Format(Date, "mmmm d,

yyyy")
> End Sub
>
> Rightclick on the excel logo to the left of File (on the worksheet

menubar) and
> select view code.
>
> Paste that code into the code window.
>
> Adjust the worksheet name and .leftheader to what you want.
>
> If you record a macro when you change the header, you'll see the syntax.
>
> Steve Adams wrote:
> >
> > How can I get the date in my header to display: "September 9, 2004"
> >
> > instead of "9/9/2004"
> >
> > right now the custom header is: &[Date]
> >
> > --
> > Thanks,
> > Steve (office 2000)

>
> --
>
> Dave Peterson
> (E-Mail Removed)



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Change Format of Date in Header Sriram Microsoft Excel Worksheet Functions 2 22nd Apr 2008 06:42 PM
How to change the default format of the date in header? Ben Graffery Microsoft Word New Users 6 14th Apr 2008 02:33 PM
Excel 2003 can you change the header date format? =?Utf-8?B?bGRlZG1vbg==?= Microsoft Excel Misc 0 7th Mar 2007 06:11 PM
how do I change date format in the header in Excel XP ? =?Utf-8?B?SGVzYW0=?= Microsoft Excel Misc 1 8th Jul 2005 06:34 PM
Possible to change date format in header/footer? StargateFan Microsoft Excel Misc 8 5th Jun 2004 11:25 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:34 AM.