View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
[email protected] dhockin@uniongas.com is offline
external usenet poster
 
Posts: 8
Default VBA format date in footer

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