Formula or code to return user name from application

General Ledger

Active Member
Joined
Dec 31, 2007
Messages
460
Dear All,

Is there a formula that will return the User Name from the setup in Excel or Windows? If no formula, VBA code will do as well.

I am creating a form using Excel 2010. I have a field where I want the name of the current user to appear rather than requiring the user to enter their name. In Excel 2010, the user name is in Excel Options > General > Personalize your copy of Microsoft Office > User name

Happy Holidays to all.

General Ledger
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
In VBA

Application.UserName will return the Excel name.

Environ("username") will return the Windows login name.
 
Upvote 0
VoG,

Perfect solution once again. Here is my final code:

Private Sub Workbook_Open()
Range("c3") = Application.UserName
End Sub

Thanks,

GL
 
Upvote 0

Forum statistics

Threads
1,215,026
Messages
6,122,738
Members
449,094
Latest member
dsharae57

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top