Is there a variable available for capturing the user name in the footer of a
document?
Similar to "&[Date]" or "&[Time]" as already exists?
Bob Phillips - 21 Feb 2006 19:02 GMT
Private Sub Workbook_BeforePrint(Cancel As Boolean)
With ActiveSheet.PageSetup
.LeftFooter = Environ("Username")
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

Signature
HTH
Bob Phillips
(remove nothere from email address if mailing direct)
> Is there a variable available for capturing the user name in the footer of a
> document?
>
> Similar to "&[Date]" or "&[Time]" as already exists?
Jim Thomlinson - 21 Feb 2006 19:09 GMT
Nothing that I know of. The variables that you speak of are both vloatile
(determined at run time). Name is not determined at run time, so it is just
hard coded in the header/footer. You could easily write some code to put the
name in the footer
Application.UserName 'The name from Tools ->Option ->General ->User Name
or
Environ("UserName") 'The users windows Login Name
If you need more help just let me know...

Signature
HTH...
Jim Thomlinson
> Is there a variable available for capturing the user name in the footer of a
> document?
>
> Similar to "&[Date]" or "&[Time]" as already exists?
Allison - 21 Feb 2006 19:20 GMT
Thanks both of you. I'd seen the VBA code before, but didn't want to go that
route.
Looks like I'm out of luck. Thanks again.
> Is there a variable available for capturing the user name in the footer of a
> document?
>
> Similar to "&[Date]" or "&[Time]" as already exists?