Can I pass network logon name to a cell in a spreadsheet?

  • Thread starter Thread starter Quality Plan
  • Start date Start date
Q

Quality Plan

I want to be able to use the user logon name to crete a filter only for that
user out of a large data set. Does Excell have a function which passes the
network login user name to a cell?
 
Hi,

This UDF should do that. Alt +F11 to open VB editor. Right click 'This
workbook' and insert module and paste this in

Function user()
user = Environ("Username")
End Function

Call with

=user()

Mike
 
This may not be good enough for the OP's purposes as the user can change his/her Excel UserName (what Application.UserName reports) anytime via the General tab of the Options dialog.
 
Function loginname()
Application.Volatile
User = Environ("username")
End Function

In a cell enter =loginname()

Copy/paste the function to a general module in your workbook.


Gord Dibben MS Excel MVP
 
Back
Top