×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Show Username in Cell
2

Show Username in Cell

Show Username in Cell

(OP)
Is there a way to have a cell in excel show the username as entered in a network login?

Thanks,

Tripp

RE: Show Username in Cell

2
You can do it with a macro.

- Go to the VB Editor (Alt-F11)
- Insert > Module
- Add the following code

Function UserName() As String
    UserName = UCase(Environ("username"))
End Function

- Close the VB Editor
- Select the target cell
- Insert > Function > User Defined > UserName
Hit OK and you should be good.

It should work on most versions of Windows (NT, 2K, XP)

DimensionalSolutions@Core.com
While I welcome e-mail messages, please post all thread activity in these forums for the benefit of all members.

RE: Show Username in Cell

(OP)
Thanks dsi.  That seems to work just right.  One more questin though.  Where do I create this module if I want it available to all my spreadsheets?

Thanks,

Tripp

RE: Show Username in Cell

You can put it in a workbook named personal.xls in the Excel startup folder.

DimensionalSolutions@Core.com
While I welcome e-mail messages, please post all thread activity in these forums for the benefit of all members.

RE: Show Username in Cell

(OP)
Thanks dsi

RE: Show Username in Cell

How do you save the function with the workbook and not just the computer it was created on?

I have created a spreadsheet and saved it on a server, When someone edits this file i want it to put their username in a cell and save it so we can see who last updated it automatically.

Any ideas?

thanks

emeralds

RE: Show Username in Cell

Just put it in the VBA project for that workbook. You will have to set the Excel Macro Security Level to Medium. This will prompt the user to enable macros. If it's set to high, it will not run without a digital certificate.

If you want it to automatically run when the file is opened, use the Workbook_Open() sub in the ThisWorkbook object to call your macro. If you only want to update upon save, use the Workbook_Save() event to trigger your macro.

DimensionalSolutions@Core.com
While I welcome e-mail messages, please post all thread activity in these forums for the benefit of all members.

RE: Show Username in Cell

HAve you looked at using Tool-Tracking function? Keeps track of each change in each cell and by who. You can then accept or reject the changes at later date if you want.

RE: Show Username in Cell

Excel has a function INFO(). Wouldn't it be nice if they added more type_text values to represent things like the user name, filename, last file saved date, etc?
JimB

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources