Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default How to identify a the user

Hello Helpers!!

What VBA code would you use to identify a the user in windows NT from excel?



Thanks in Advance!!


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default How to identify a the user

try this

Environ("UserName")

--


Gary


"Angelo Battistoni" wrote in message
...
Hello Helpers!!

What VBA code would you use to identify a the user in windows NT from
excel?



Thanks in Advance!!




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 441
Default How to identify a the user

You may wish to try any or all of the following which return different bits
of info as labeled:

Public Function ReturnUserName() As String
'RETURN THE USER NAME AS RECORDED IN [TOOLS][OPTIONS][GENERAL]
ReturnUserName = Application.UserName
End Function

Public Function ReturnNetworkName() As String
'RETURNS NETWORK LOGIN ID OF CURRENT USER
ReturnNetworkName = Environ("UserName")
End Function

Public Function ReturnComputerName() As String
'RETURNS COMPUTER NUMBER USER IS ON
ReturnComputerName = Environ("ComputerName")
End Function

Use these like this example:

Dim sUser as String
sUser = ReturnNetworkName
Msgbox sUser

HTH.

"Angelo Battistoni" wrote:

Hello Helpers!!

What VBA code would you use to identify a the user in windows NT from excel?



Thanks in Advance!!



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to identify operating system user in excel? Sarita Excel Programming 4 July 21st 05 05:29 PM
Identify when a user attempts to turn on "Allow cell drag and drop" Alan Excel Programming 9 November 21st 04 09:09 PM
Identify User Selected Range RonF Excel Programming 3 January 12th 04 04:36 PM
Identify Range Selected By User RonF Excel Programming 1 January 9th 04 05:29 PM
Identify if another user has spreadsheet open - in VBA gp Excel Programming 3 December 9th 03 09:10 PM


All times are GMT +1. The time now is 09:48 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"