SYSTEM VALUES as footer

  • Thread starter Thread starter AMAYES
  • Start date Start date
A

AMAYES

I need to know how to insert the system register user name
as a footer in a document.
I create documents and e-mail them - then they get changed
and printed - I want to know which system was the
worksheet printed from.
 
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 = Environ("computername")
End With
Next wkSht
End Sub
 
Back
Top