Header/Footer Date Format

D

David

Hi, I would like to have my date format in the header/footer to be
dd/MMM/yyyy. However the 'Date Button' in the header screen only gives me a
format of dd/MM/yyyy. My Regional settings are as i need them to be. Date
format in my actual worksheet is as i want it.....just not in the
header/footer ?
 
R

Ron@Buy

This is a bit basic but the way I've achieved this is to actually go into the
footer and type in the date exactly as you want it to appear.
 
R

Roger Govier

Hi David

You would have to use code to change it.

You could add the following code to the ThisWorkbook Module

Private Sub Workbook_BeforePrint(Cancel As Boolean)
ActiveSheet.PageSetup.CenterFooter = Format(Date, "dd mmm yyyy")
End Sub

Copy the Code above
Alt+F11 to invoke the VB Editor
Double click on the ThisWorkbook module in Project Explorer
Paste code into white pane that appears
Alt+F11 to return to Excel

It will get invoked automatically when you Print or do a Print Preview
 

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