+ Reply to Thread
Results 1 to 2 of 2

windows username

Hybrid View

  1. #1
    Forum Contributor max_max's Avatar
    Join Date
    06-28-2013
    Location
    italy - venice
    MS-Off Ver
    Excel 2007
    Posts
    1,693

    windows username

    Hello to all,
    you can enter in a cell who is using the computer or excel? Is there a formula or do I need a macro?
    max_max
    --------------------------------------------------------------------------------------------------------------
    Ciao a tutti,
    è possibile inserire in una cella chi sta usando il computer o excel? C'è una formula oppure ho bisogno di una macro?
    max_max

  2. #2
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: windows username

    I couldn't find any built in function for this.

    Try the following Macro:
    Sub TestEnvironmentVariable()
      Dim sEnvVariableName As String
      
      sEnvVariableName = "USERNAME"
      Range("A1") = GetEnvironmentVariableValue(sEnvVariableName)
    End Sub
    
    Function GetEnvironmentVariableValue(sEnvVariableName As String)
      GetEnvironmentVariableValue = Environ(sEnvVariableName)
    End Function

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. getting windows username into excel
    By Billy_E in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-13-2013, 12:53 PM
  2. Get Actual Windows Username
    By RedWing in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-17-2012, 08:11 PM
  3. SQL Statement WHERE User = Windows Username ID
    By JohnGaltnl in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-07-2011, 04:24 AM
  4. windows 2003 server username
    By neta in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-29-2008, 08:07 AM
  5. [SOLVED] Windows API to get network username of person with file open
    By Paul Martin in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-02-2005, 12:35 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1