Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Reference a User Name via macro
What code should I use to reference the current user that is saved within
Excel. When the macro is run, in A2 I would like it to display the user that ran the macro Range("A2").Value = current user name Thanks, Paul |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Reference a User Name via macro
Range("A2").Value = environ("username")
or perhaps you are looking for application.Username which is what is entered in Tools=Options=General tab -- Regards, Tom Ogilvy "PCLIVE" wrote in message ... What code should I use to reference the current user that is saved within Excel. When the macro is run, in A2 I would like it to display the user that ran the macro Range("A2").Value = current user name Thanks, Paul |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Reference a User Name via macro
Range("A2").Value = Environ("UserName")
should work "PCLIVE" wrote: What code should I use to reference the current user that is saved within Excel. When the macro is run, in A2 I would like it to display the user that ran the macro Range("A2").Value = current user name Thanks, Paul |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Reference a User Name via macro
Tom,
Thank you. You have covered both areas, one of which I will definitely use. After testing each method you've suggested, I will most likely use environ("Username"). After testing this I'm assuming that this is pulling from the "Computer Name" set in Device Manager. Thanks again for your help. Paul "Tom Ogilvy" wrote in message ... Range("A2").Value = environ("username") or perhaps you are looking for application.Username which is what is entered in Tools=Options=General tab -- Regards, Tom Ogilvy "PCLIVE" wrote in message ... What code should I use to reference the current user that is saved within Excel. When the macro is run, in A2 I would like it to display the user that ran the macro Range("A2").Value = current user name Thanks, Paul |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Minimum and maximum value of Axis set by user by reference to form | Charts and Charting in Excel | |||
How do you reference the logged on user name in excel? | Excel Discussion (Misc queries) | |||
can a User Form reference several sheets? | Excel Programming | |||
How to: User Form to assign a user defined range to a macro variab | Excel Programming | |||
Allow user-entered file reference | Excel Programming |