ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   User name (https://www.excelbanter.com/excel-discussion-misc-queries/129238-user-name.html)

mkraizrool

User name
 
The user name is set in ToolsOptionsGeneral tab

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

Bob Phillips

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?




Martin Fishlock

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?


mkraizrool

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?





Martin Fishlock

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?





Mike Rogers

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?


Brian

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?





CarpeDiem

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.


All times are GMT +1. The time now is 08:28 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com