Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Need some code for header/ footer, another case of "last saved by.

0 views
Skip to first unread message

hspence

unread,
Dec 28, 2006, 12:05:01 PM12/28/06
to
I've seen lots of examples on here that does one or the other, but can't find
a piece of code that does both.

In my footer, I want to display the name of the person who last modified the
file, and the date & time it was saved. I also want the font size to be 20.

In plain english, it would read:

Last Modified by [last author] on dd-mmm-yyyy hh:mm:ss

If you can steer me to such an example, or write it here for me, I would
very much appreciate it.

THanks!

Jim Thomlinson

unread,
Dec 28, 2006, 12:30:00 PM12/28/06
to
Give this a try... Just change the sheet reference...

With ThisWorkbook
Sheets("Sheet1").PageSetup.LeftFooter = "Last modified by " & _
.BuiltinDocumentProperties("Last Author") & " on " & _
.BuiltinDocumentProperties("Last Save Time")
End With

--
HTH...

Jim Thomlinson

hspence

unread,
Dec 28, 2006, 2:11:01 PM12/28/06
to
Hi Jim,

sorry, this doesn't seem to be working for me, but I have not programmed
much, so perhaps I am not changing the sheet reference correctly?? I'd like
this to run on all sheets in the workbook.

Ron de Bruin

unread,
Dec 28, 2006, 4:20:34 PM12/28/06
to
Try this hspence

http://www.rondebruin.nl/print.htm#Saved

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"hspence" <hsp...@discussions.microsoft.com> wrote in message news:B577AB36-A652-4BEC...@microsoft.com...

hspence

unread,
Dec 28, 2006, 5:00:01 PM12/28/06
to
Thank you Ron & Jim...this what I came up with as a result of both your
posts, and it seems to work for me. I am sure it is not as efficient as it
might be, but for a first timer I am pleased, and I thank you for your help.
I'll probably ping you tomorrow when this fails me and I can't figure it out.
I've ordered John W.'s Power Programming for excel guide, if there is
another primer that is for novices like me, I'd appreciate you recomendations.

Again, thanks.

Private Sub Workbook_BeforePrint(Cancel As Boolean)
Dim wkSht As Worksheet
For Each wkSht In ThisWorkbook.Worksheets
wkSht.PageSetup.RightFooter = ("&20Last Saved or Modified by ") & _
(Format(ThisWorkbook.BuiltinDocumentProperties("Last Author"))) &
("&20 on ") & _
(Format(ThisWorkbook.BuiltinDocumentProperties("Last Save Time")))
Next wkSht
End Sub

0 new messages