ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Retrieve ID from NT? (https://www.excelbanter.com/excel-discussion-misc-queries/222757-retrieve-id-nt.html)

Don

Retrieve ID from NT?
 
Within Excel , can it tell you the name of the person who is accessing the
file =

1) The name they put in Excel or
2) System Login ID (from NT?)

thanks in advance

Gary''s Student

Retrieve ID from NT?
 
There are two names:

1. login name
2. user name specified in Tools Options General User name

here are two User Defined Functions:

Function officeUser() As String
officeUser = Application.UserName
End Function


Function LogOnName() As String
LogOnName = Environ("username")
End Function


UDFs are very easy to install and use:

1. ALT-F11 brings up the VBE window
2. ALT-I
ALT-M opens a fresh module
3. paste the stuff in and close the VBE window

If you save the workbook, the UDF will be saved with it.

To use the UDF from the normal Excel window, just enter it like a normal
Excel Function

To remove the UDF:

1. bring up the VBE window as above
2. clear the code out
3. close the VBE window

To learn more about UDFs, see:

http://www.cpearson.com/excel/Writin...ionsInVBA.aspx

--
Gary''s Student - gsnu200835


"Don" wrote:

Within Excel , can it tell you the name of the person who is accessing the
file =

1) The name they put in Excel or
2) System Login ID (from NT?)

thanks in advance


Don

Retrieve ID from NT?
 
this realy helps, thanks

"Gary''s Student" wrote:

There are two names:

1. login name
2. user name specified in Tools Options General User name

here are two User Defined Functions:

Function officeUser() As String
officeUser = Application.UserName
End Function


Function LogOnName() As String
LogOnName = Environ("username")
End Function


UDFs are very easy to install and use:

1. ALT-F11 brings up the VBE window
2. ALT-I
ALT-M opens a fresh module
3. paste the stuff in and close the VBE window

If you save the workbook, the UDF will be saved with it.

To use the UDF from the normal Excel window, just enter it like a normal
Excel Function

To remove the UDF:

1. bring up the VBE window as above
2. clear the code out
3. close the VBE window

To learn more about UDFs, see:

http://www.cpearson.com/excel/Writin...ionsInVBA.aspx

--
Gary''s Student - gsnu200835


"Don" wrote:

Within Excel , can it tell you the name of the person who is accessing the
file =

1) The name they put in Excel or
2) System Login ID (from NT?)

thanks in advance


Francis

Retrieve ID from NT?
 
Hi try this User Define Function

1) Press Alt + F11
2) Select ThisWorkbook, right click and choose Insert then Module
3) Paste the code below into this module

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

4) close the VBE editor
5) Call this function by placing the formula in a cell, eg A1
=UserName()


--
Hope this is helpful

Pls click the Yes button below if this post provide answer you have asked


Thank You

cheers, francis










"Don" wrote:

Within Excel , can it tell you the name of the person who is accessing the
file =

1) The name they put in Excel or
2) System Login ID (from NT?)

thanks in advance



All times are GMT +1. The time now is 07:21 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com