"Printed by:" in Footer

  • Thread starter Thread starter Ruan
  • Start date Start date
R

Ruan

Hello,

Is there a way to display the User who printed the document in the Footer?

Thanks
Ruan
 
Hi
Put the following code in your workbook module (not in a standard
module):
Private Sub Workbook BeforePrint(Cancel As Boolean)
Dim wkSht As Worksheet
For Each wkSht In me.Worksheets
With wkSht.PageSetup
.CenterFooter = "Printed by: " & application.username
End With
Next wkSht
End Sub
 
Thanks Frank,

That worked really great.

Ruan


Frank Kabel said:
Hi
Put the following code in your workbook module (not in a standard
module):
Private Sub Workbook BeforePrint(Cancel As Boolean)
Dim wkSht As Worksheet
For Each wkSht In me.Worksheets
With wkSht.PageSetup
.CenterFooter = "Printed by: " & application.username
End With
Next wkSht
End Sub
 
Frank.........
Is this code intended to return the User that the Excel is installed to, or
the User who signed on the computer?

Vaya con Dios,
Chuck, CABGx3
 
Hi
the first one :-)
For the latter one you'll need a different approach. e.g.

Public Function WinUserName() As String
WinUserName = Environ("UserName")
End Function
 
Back
Top