View Single Post
  #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