mthompso
Board Regular
- Joined
- Apr 18, 2008
- Messages
- 123
The following VBA code, executed on a Windows Network computer, will give me the Windows Login ID of the user that's logged in to the computer:
How do I get the full user name, not just the Windows Login ID?
Example: On this specific Windows network, the login id is the first letter of the user's first name followed by their last name. John Doe's login id is JDOE. How can I get VBA to give me the string "John Doe" and not "JDOE"?
Code:
Sub UserName()
MsgBox Environ("username")
End Sub
How do I get the full user name, not just the Windows Login ID?
Example: On this specific Windows network, the login id is the first letter of the user's first name followed by their last name. John Doe's login id is JDOE. How can I get VBA to give me the string "John Doe" and not "JDOE"?