Thread: User name
View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.misc
Brian Brian is offline
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?