Consulting

Results 1 to 4 of 4

Thread: Solved: INCLUDE NAME/MNEMONIC IN MSGBOX

  1. #1

    Red face Solved: INCLUDE NAME/MNEMONIC IN MSGBOX

    Hi,

    I have a message function that returns data based on what macro etc has been run, kind of like a log of all things run on that day and what time.

    I am trying to expand this to who has run what, i.e. there are several people who can run these so i want to add an extra piece in that will identify who has run each macro.

    If i could even get the individual mnemonic into a msgbox i could work from there myself, for example john doe's login to a pc could be JD1, or DOEJ or JDOE etc.

    Any help would go a long way!!

    Sarah

  2. #2
    VBAX Mentor tstav's Avatar
    Joined
    Feb 2008
    Location
    Athens
    Posts
    350
    Location
    [vba]
    'Get username
    strUser = Environ("UserName")
    'strUser = Environ.("UserName")
    'Get Computer
    strComputer = Environ("ComputerName")
    'strComputer = Environ.("ComputerName")
    [/vba]
    Last edited by tstav; 04-22-2008 at 03:14 AM.
    He didn't know it was impossible, so he did it. (Jean Cocteau)

  3. #3
    Hi,

    Think my version of Excel may be a bit donkey - i changed it a bit and got it working. Thats's brilliant thanks for all your help, this will work perfectly.

    Have a nice day

    Sarah


    [VBA]Sub test()
    Dim strUser As String
    Dim strComputer As String
    'Get username
    strUser = Environ("UserName")
    'Get Computer
    strComputer = Environ("ComputerName")
    MsgBox strUser
    MsgBox strComputer
    End Sub[/VBA]

  4. #4
    VBAX Mentor tstav's Avatar
    Joined
    Feb 2008
    Location
    Athens
    Posts
    350
    Location
    Computers always know what they're doing Sarah.
    Shouldn't have entered the dots (of course...)

    Have a nice day
    He didn't know it was impossible, so he did it. (Jean Cocteau)

Posting Permissions

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