format the "date" button for a header

G

Guest

I need to insert a date in my header but not in the short format currently
provided by pressing the "date" button.

Is there a forumala etc that I can use that will change the format of this
particular date without going through computer settings and chaning the
"standard" date option. (much like how you can format a normal cell to show
the date in whatever format you require
 
J

JE McGimpsey

You can use this macro:

Public Sub DateInHeader()
Dim ws As Worksheet
For Each ws In ActiveWindow.SelectedSheets
ws.PageSetup.LeftHeader = Format(Date, "dd mmm yyyy")
Next ws
End Sub

Change the date format to suit.

You can also use .CenterHeader or .RightHeader
 

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

Similar Threads


Top