#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default User name

The user name is set in ToolsOptionsGeneral tab

How can I get that user name to display in a cell?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,593
Default User name

Create a UDF

Function ThisUser()
ThisUser = Application.UserName
End Function

and call like =ThisUser()

You could even get the logon user name, which is more robust

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

--
HTH

Bob Phillips

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"mkraizrool" wrote in message
...
The user name is set in ToolsOptionsGeneral tab

How can I get that user name to display in a cell?



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 694
Default User name

Hi mkraizrool:

You need to user vba and it is a simple function.

Function GetUserName() As String
GetUserName = Application.UserName
End Function

To open the vba enter ALT+F11.
Insert a module ALT+I M
paste it in and then in cell A1 =GetUserName()
and it should work.
--
Hope this helps
Martin Fishlock, Bangkok, Thailand
Please do not forget to rate this reply.


"mkraizrool" wrote:

The user name is set in ToolsOptionsGeneral tab

How can I get that user name to display in a cell?

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default User name

Thanks

Is there a formula?? (i.e a way without resorting to VBA? - Icould just
about cope with you suggestion - but the person I'm trying to help
couldn't...)


"Bob Phillips" wrote:

Create a UDF

Function ThisUser()
ThisUser = Application.UserName
End Function

and call like =ThisUser()

You could even get the logon user name, which is more robust

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

--
HTH

Bob Phillips

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"mkraizrool" wrote in message
...
The user name is set in ToolsOptionsGeneral tab

How can I get that user name to display in a cell?




  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 694
Default User name

Unfortunately it is one of the things that is missing.

I don't know about the version.

--
Hope this helps
Martin Fishlock, Bangkok, Thailand
Please do not forget to rate this reply.


"mkraizrool" wrote:

Thanks

Is there a formula?? (i.e a way without resorting to VBA? - Icould just
about cope with you suggestion - but the person I'm trying to help
couldn't...)


"Bob Phillips" wrote:

Create a UDF

Function ThisUser()
ThisUser = Application.UserName
End Function

and call like =ThisUser()

You could even get the logon user name, which is more robust

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

--
HTH

Bob Phillips

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"mkraizrool" wrote in message
...
The user name is set in ToolsOptionsGeneral tab

How can I get that user name to display in a cell?






  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 194
Default User name

mkraizrool

Bob's solution seems to work for me. Copy Bob's code into a Module and in
the cell that you want the user name displayed place the formula =ThisUser()
and enter out. The name is there. Kinda Cool!!!

Mike Rogers

"mkraizrool" wrote:

The user name is set in ToolsOptionsGeneral tab

How can I get that user name to display in a cell?

  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 683
Default User name

try this: after a save it will apply.

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, _
Cancel As Boolean)
ActiveSheet.Range("C4").Value = Format(Now, "dd mmm yyyy hh:mm") + " "
+ Environ("UserName")
End Sub
--
Brian


"Bob Phillips" wrote:

Create a UDF

Function ThisUser()
ThisUser = Application.UserName
End Function

and call like =ThisUser()

You could even get the logon user name, which is more robust

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

--
HTH

Bob Phillips

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"mkraizrool" wrote in message
...
The user name is set in ToolsOptionsGeneral tab

How can I get that user name to display in a cell?




  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5
Default User name

How Can I make this function to work on a protected sheet (Excel version: 2003)

The Code:

Function LSUser()
LSUser = Environ("username")

End Function

Much appreciated if I could get the answer for this issue :-). The function
works fine on a protected sheet in Excel:2007, In Excel: 2003 it doesn't
changes the name if a new user updates the worksheet. All the cells in the
worksheet are write protected except for some on which the user enters the
information and then saves it. The worksheet was designed and created in
excel 2003.
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
Formulas Changed when User Downloaded Spreadsheet Connie Excel Discussion (Misc queries) 14 October 20th 06 11:16 AM
start a macro or procedure based on user putting an x in a cell mathew Excel Discussion (Misc queries) 0 August 17th 06 06:21 PM
Start Macro after user selects a choice from a pick list mathew Excel Discussion (Misc queries) 2 August 17th 06 03:28 PM
Final days for regular registration - London Excel User Conference - July 19-21 Damon Longworth Excel Worksheet Functions 0 June 9th 06 12:29 PM
Example User Form Required robertguy Excel Discussion (Misc queries) 0 October 4th 05 02:25 PM


All times are GMT +1. The time now is 09:09 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"