Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Taurus
 
Posts: n/a
Default How do you reference the logged on user name in excel?

I am making a template that sever users will be using this & I don't know how
to automatically put the logged in users name into the header. Can someone
help with this???
  #2   Report Post  
Posted to microsoft.public.excel.misc
Leith Ross
 
Posts: n/a
Default How do you reference the logged on user name in excel?


Hello Taurus,

The name of the current user can be returned using
Application.UserName. There are 3 headers on each Worksheet, Left,
Center, and Right. These are accessed through PageSetup.

Example for Left Header:
Worksheets("Sheet1").PageSetup.LeftHeader = Application.UserName

Example for Center Header:
Worksheets("Sheet1").PageSetup.CenterHeader = Application.UserName

Example for Right Header:
Worksheets("Sheet1").PageSetup.RightHeader = Application.UserName

Remember this has to be done to each sheet you want a header to appear
on. Replace "Sheet1" in the examples with the name of Worksheet that
will have a header.

Sincerely,
Leith Ross


--
Leith Ross
------------------------------------------------------------------------
Leith Ross's Profile: http://www.excelforum.com/member.php...o&userid=18465
View this thread: http://www.excelforum.com/showthread...hreadid=504577

  #3   Report Post  
Posted to microsoft.public.excel.misc
Taurus
 
Posts: n/a
Default How do you reference the logged on user name in excel?

Leith,

Is this using the VBA part of excel? I am pretty much a newbie in that. I
have written any type of VB code in a while... I will try to keep at it but
s far I am unsuccsessful.

Sincerely, Taurus.

"Leith Ross" wrote:


Hello Taurus,

The name of the current user can be returned using
Application.UserName. There are 3 headers on each Worksheet, Left,
Center, and Right. These are accessed through PageSetup.

Example for Left Header:
Worksheets("Sheet1").PageSetup.LeftHeader = Application.UserName

Example for Center Header:
Worksheets("Sheet1").PageSetup.CenterHeader = Application.UserName

Example for Right Header:
Worksheets("Sheet1").PageSetup.RightHeader = Application.UserName

Remember this has to be done to each sheet you want a header to appear
on. Replace "Sheet1" in the examples with the name of Worksheet that
will have a header.

Sincerely,
Leith Ross


--
Leith Ross
------------------------------------------------------------------------
Leith Ross's Profile: http://www.excelforum.com/member.php...o&userid=18465
View this thread: http://www.excelforum.com/showthread...hreadid=504577


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel file opened as read-only, if saved by another user GeEf Excel Discussion (Misc queries) 2 August 28th 05 04:29 PM
Can excel files be opened in fixed screen size preset by user? vabraham Excel Discussion (Misc queries) 1 August 28th 05 03:08 PM
Final week - 2005 Excel User Conference - Ft. Worth, Texas - Sept 16/17 Damon Longworth Excel Discussion (Misc queries) 0 August 24th 05 01:22 PM
Final week - 2005 Excel User Conference - Ft. Worth, Texas - Sept 16/17 Damon Longworth Excel Worksheet Functions 0 August 24th 05 12:14 PM
Formula for Excel User Name Shelll Excel Worksheet Functions 9 May 27th 05 11:01 AM


All times are GMT +1. The time now is 07:50 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"