VBA format date in footer

D

dhockin

Want to format the date in the footer. Would like ddd-mmm-dd, yyyy.
Date needs to stay current, can't be static, so the function below is
the what I am using now, but I need to format the date portion.

I recall this needs double sets of double quotes but can't quite get
it right.

Function PutFileNameInFooter(sh As Worksheet)
With sh.PageSetup
.RightHeader = "&9SheetName>>> &A"
.LeftFooter = "&8&Z&F" & Chr(10) & "Printed: " & "&D &T"
.RightFooter = "" & Chr(10) & "&8Page &P of &N"
End With
End Function

want
.LeftFooter = "&8&Z&F" & Chr(10) & "Printed: " & "&format(D,"ddd-mmm-
dd, yyyy") &T"
such that is would be Mon Jun 05, 2007
 
R

Rick Rothstein \(MVP - VB\)

want
.LeftFooter = "&8&Z&F" & Chr(10) & "Printed: " & "&format(D,"ddd-mmm-
dd, yyyy") &T"
such that is would be Mon Jun 05, 2007

Change the dashes in the Format function call to blank spaces?

Rick
 

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