Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / February 2006

Tip: Looking for answers? Try searching our database.

Footer variable for user name?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Allison - 21 Feb 2006 18:37 GMT
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?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.