View Single Post
  #4   Report Post  
Bob Phillips
 
Posts: n/a
Default Modifying a footer date

Mary,

Try this

Private Sub Workbook_BeforePrint(Cancel As Boolean)
Dim sTemp As String
Dim iPos As Long
With ActiveSheet.PageSetup
sTemp = .LeftFooter
iPos = InStr(sTemp, "Last Printed:")
If iPos 0 Then
sTemp = Left(sTemp, iPos - 1)
End If
.LeftFooter = sTemp & vbNewLine & _
"Last Printed: " & Format(Date, "dd-mmm-yyyy")
End With
End Sub

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Mary Sasiela" wrote in message
...
Hello
I would like something similar. In the center footer (I've already

modified
'Left" to "center' in the string), I need a line of text in the center

footer
with the text "Last Printed 25-OCT-2005" (for example) on the second line

of
the footer. So it would read in center footer:
Effective date - whatever text I type - not an updatable field
Last Printed &[Date]
(where the format must be dd-MMM-yyyy)

When I use Bob's string below, it's overwriting my first line of code.

My thx. in advance for your help.

Mary

"Bob Phillips" wrote:

If you do use the print the date technique you can specify its format


Private Sub Workbook_BeforePrint(Cancel As Boolean)
With ActiveSheet.PageSetup
.LeftFooter = Format(Date, "dddd, mmmm dd, yyyy")
End With
End Sub
'This is workbook event code.
'To input this code, right click on the Excel icon on the worksheet
'(or next to the File menu if you maximise your workbooks),
'select View Code from the menu, and paste the code



--

HTH

RP
(remove nothere from the email address if mailing direct)


"jim314" wrote in message
...
First, just to clarify, I am NOT looking to print the date/time the

file
was
last modified, but rather I am looking to modify the default date

format
that
Excel displays on the footers. How can this be done?

Example:
Currently the date looks like this: 10/21/05
I would like the date to look like this: Friday, October 21, 2005

Thanks in advance,

Jim