Results 1 to 4 of 4
  1. #1
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    user name in the cell (2000 sr.1)

    .. i have read on one site (but dont rember where) is possible via VBA for Excel intercept the USERNAME, and other iformation, of the current user logged?
    If yes, how to insert in a cell the name of the user?

  2. #2
    Platinum Lounger
    Join Date
    Jan 2001
    Posts
    3,788
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: user name in the cell (2000 sr.1)

    Hi Sal

    See the thread beginning with <post#=293049>post 293049</post#>

  3. #3
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: user name in the cell (2000 sr.1)

    tKS ALL OK!
    Is posiible to insert always in capital letter this variable in A3?

    Sub USER_NAME()
    Dim wshNet
    Workbooks("L0785_DEF.XLS").Activate
    Sheets("L0785_TOTALE").Select
    Set wshNet = CreateObject("WScript.Network")
    wshGetUserName = wshNet.UserName
    Set wshNet = Nothing
    Range("A3") = ""
    Range("A3") = wshGetUserName
    End Sub

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: user name in the cell (2000 sr.1)

    You should be able to solve that yourself now! Replace the lines

    Range("A3") = ""
    Range("A3") = wshGetUserName

    (of which the first is not necessary) with

    Range("A3") = UCase(wshGetUserName)

    The UCase function changes its argument to upper case (=all capitals)

Posting Permissions

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