Custom Footer

  • Thread starter Thread starter SteveO
  • Start date Start date
S

SteveO

Hello All,

I would like to display the name of the creator of a file
in the footer. At the least, the person to last access
teh file.

I know in VB it is Application.Username, not sure how to
do it in the footer.

Thanks in advance
 
Hi Steve,
Actually the last peson to change the file:

Option Explicit
Private Sub Workbook_BeforePrint(Cancel As Boolean)
'Documented in http://www.mvps.org/dmcritchie/excel/pathname.htm
'Install in ThisWorkbook in the Project Library of your workbook
'Alt+F11 (switch to VBE), Ctrl+R (object explorer),
'find/install in "ThisWorkbook" under "Microsoft Excel Objects"
Dim wkSht As Worksheet
For Each wkSht In ActiveWindow.SelectedSheets
With wkSht.PageSetup
.LeftFooter = "&8" & LCase(ActiveWorkbook.FullName) _
& " &A "
.CenterFooter = "Page &P of &N"
' .RightFooter = "&8 &D &T"
.RightFooter = "&8 " & _
Application.UserName & ", " _
& Format(Now(), "yyyy-mm-dd") & " &T"
End With
Next wkSht
End Sub

The above username is the name in your Tools, Options, General
and should reflect how the peson wants to see their own name.

If on a network you may want to choose something else.
Userid / machine name / identity / properties
http://www.mvps.org/dmcritchie/excel/userid.htm
 
Back
Top