page numbering

J

jamessem

I want to change the way the date appears in the footer and header.
Currently the date is day/month/year. I want month/day/year.

setting the date to a particular format is easy in a cell.
How do I set the date format in the header and footer?
 
P

Paul B

jamessem, you could use a macro like this to do it
Sub test()
With ActiveSheet.PageSetup
.LeftFooter = Format(Date, "mmmm dd, yyyy")
End With
End Sub

--
Paul B
Always backup your data before trying something new
Using Excel 2000 & 97
Please post any response to the newsgroups so others can benefit from it
** remove news from my email address to reply by email **
 
J

james s shoenfelt

Jamessem -
On second thought - I think this code (which I also found on these
newsgroups) works even better:

From: Orlando Magalhães Filho ([email protected])
Subject: Re: excel97. format date in footer


View this article only
Newsgroups: microsoft.public.excel.programming
Date: 2003-03-02 05:17:13 PST


Hi George Attard,

I think you have to use a code event. Try this:.

- Open your workbook
- Press Alt+F11
- On VBE window double click ThisWorkbook object.
- Insert an code like this.

Private Sub Workbook_BeforePrint(Cancel As Boolean)
With ActiveSheet.PageSetup
.CenterFooter = Format(Date, "ddmmmyy")
End With
End Sub

HTH
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top