Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
TBoeck
 
Posts: n/a
Default Formula returning current user name

I'd like to find a way to have a cell automatically display the current user
name as shown in Tools/Options/General/User name.

Thanks for the help.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bob Phillips
 
Posts: n/a
Default Formula returning current user name

You need a VBA UDF

Function UserName()
Username=application.UserName
End Function


and then in the worksheet, use
=UserName()

--

HTH

RP
(remove nothere from the email address if mailing direct)


"TBoeck" wrote in message
...
I'd like to find a way to have a cell automatically display the current

user
name as shown in Tools/Options/General/User name.

Thanks for the help.



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
TBoeck
 
Posts: n/a
Default Formula returning current user name

Bob,

Thank you for the help. Just one last question (can ya tell I'm new?), what
is a "VBA UDF"

"Bob Phillips" wrote:

You need a VBA UDF

Function UserName()
Username=application.UserName
End Function


and then in the worksheet, use
=UserName()

--

HTH

RP
(remove nothere from the email address if mailing direct)


"TBoeck" wrote in message
...
I'd like to find a way to have a cell automatically display the current

user
name as shown in Tools/Options/General/User name.

Thanks for the help.




  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bob Phillips
 
Posts: n/a
Default Formula returning current user name

Essentially it is a macro that you can call directly from the worksheet, as
it it were a function (UDF - User Defined Function). To create it, in Excel
Alt-F11 will take you into the VBIDE. In the menu, select InsertModule,
then just copy that code into there. Then close the VBIDE.

BTW, you can also get the login name which is a bit more reliable than the
application name, as the user cannot change it. The VBA for that is

Function UserName()
UserName = Environ("UserName")
End Function

--

HTH

RP
(remove nothere from the email address if mailing direct)


"TBoeck" wrote in message
...
Bob,

Thank you for the help. Just one last question (can ya tell I'm new?),

what
is a "VBA UDF"

"Bob Phillips" wrote:

You need a VBA UDF

Function UserName()
Username=application.UserName
End Function


and then in the worksheet, use
=UserName()

--

HTH

RP
(remove nothere from the email address if mailing direct)


"TBoeck" wrote in message
...
I'd like to find a way to have a cell automatically display the

current
user
name as shown in Tools/Options/General/User name.

Thanks for the help.






  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
TBoeck
 
Posts: n/a
Default Formula returning current user name

Bob,

I can't thank you enough. My boss will be VERY pleased.

Tim

"Bob Phillips" wrote:

Essentially it is a macro that you can call directly from the worksheet, as
it it were a function (UDF - User Defined Function). To create it, in Excel
Alt-F11 will take you into the VBIDE. In the menu, select InsertModule,
then just copy that code into there. Then close the VBIDE.

BTW, you can also get the login name which is a bit more reliable than the
application name, as the user cannot change it. The VBA for that is

Function UserName()
UserName = Environ("UserName")
End Function

--

HTH

RP
(remove nothere from the email address if mailing direct)


"TBoeck" wrote in message
...
Bob,

Thank you for the help. Just one last question (can ya tell I'm new?),

what
is a "VBA UDF"

"Bob Phillips" wrote:

You need a VBA UDF

Function UserName()
Username=application.UserName
End Function


and then in the worksheet, use
=UserName()

--

HTH

RP
(remove nothere from the email address if mailing direct)


"TBoeck" wrote in message
...
I'd like to find a way to have a cell automatically display the

current
user
name as shown in Tools/Options/General/User name.

Thanks for the help.








  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Formula returning current user name

All,

This thread was very helpful. One issue that I am encountering is when I
send the sheet to other users, the UDF doesn't update (the UDF below that
gets the login name).

Is there a way to force this UDF to exectue upon opening the sheet?

Thanks,
Dennis


"TBoeck" wrote:

Bob,

I can't thank you enough. My boss will be VERY pleased.

Tim

"Bob Phillips" wrote:

Essentially it is a macro that you can call directly from the worksheet, as
it it were a function (UDF - User Defined Function). To create it, in Excel
Alt-F11 will take you into the VBIDE. In the menu, select InsertModule,
then just copy that code into there. Then close the VBIDE.

BTW, you can also get the login name which is a bit more reliable than the
application name, as the user cannot change it. The VBA for that is

Function UserName()
UserName = Environ("UserName")
End Function

--

HTH

RP
(remove nothere from the email address if mailing direct)


"TBoeck" wrote in message
...
Bob,

Thank you for the help. Just one last question (can ya tell I'm new?),

what
is a "VBA UDF"

"Bob Phillips" wrote:

You need a VBA UDF

Function UserName()
Username=application.UserName
End Function


and then in the worksheet, use
=UserName()

--

HTH

RP
(remove nothere from the email address if mailing direct)


"TBoeck" wrote in message
...
I'd like to find a way to have a cell automatically display the

current
user
name as shown in Tools/Options/General/User name.

Thanks for the help.






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
formula to calculate age using birth date and current date lalah Excel Worksheet Functions 2 November 20th 05 10:51 PM
Array formula returning wrong results TUNGANA KURMA RAJU Excel Discussion (Misc queries) 1 November 19th 05 10:29 AM
Array formula returning terminated employees malik641 Excel Worksheet Functions 4 August 16th 05 03:24 PM
New user needing help with coming up with a formula Igniter New Users to Excel 2 June 2nd 05 07:10 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 06:41 PM.

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"