+ Reply to Thread
Results 1 to 10 of 10

Auto Inserting MS Office Username on Event Change

  1. #1
    Registered User
    Join Date
    05-06-2005
    Posts
    30

    Auto Inserting MS Office Username on Event Change

    I have a shared spreadsheet that uses a column with a validation list. I want to be able to take the MS Office Username contained in Tools > Options to be put into a cell A1 when changing the value of A2.

    Is it possible?

  2. #2
    Forum Expert
    Join Date
    12-29-2004
    Location
    Michigan, USA
    MS-Off Ver
    2013
    Posts
    2,208
    Right-click on the sheet tab, select view code, and copy and paste the following:
    Please Login or Register  to view this content.
    This will enter the MS Excel user name in cell A1 whenever cell B1 is anything except blank. Is this what you were looking for?

  3. #3
    Registered User
    Join Date
    05-06-2005
    Posts
    30
    Will this work for the range of a column or is it cell specific? Other than that, it's exactly what I was inquiring about. Thanks!

  4. #4
    Forum Expert
    Join Date
    12-29-2004
    Location
    Michigan, USA
    MS-Off Ver
    2013
    Posts
    2,208
    For a range of cells, you would need a little extra code:
    Please Login or Register  to view this content.
    You can change the red range above to suit your needs.

  5. #5
    Registered User
    Join Date
    05-06-2005
    Posts
    30
    Thanks again. I tried the code and it works, but puts the value in a singular specific field. I don't think I'm explaining myself correctly.

    For every cell in the range (let's say A3:A1501) that changes to Y, I need the corresponding cell in B3:B1501 to change to the username.

    thanks again

  6. #6
    Forum Expert
    Join Date
    12-29-2004
    Location
    Michigan, USA
    MS-Off Ver
    2013
    Posts
    2,208
    After playing around with code for a while and wondering why I couldn't get it to work, I realized I was using the SelectionChange event, rather than the Change event. OOPS! This code should work for you hopefully:
    Please Login or Register  to view this content.
    Last edited by jasoncw; 01-25-2007 at 06:54 PM.

  7. #7
    Registered User
    Join Date
    05-06-2005
    Posts
    30
    That works great! Thanks again. I did run into an unexpected scenario though and was wondering if the code could be moded easily to accomodate the encounter.

    If you clear a cell that is currently not null, can the username then be removed from the target cell?

    You rock man! thanks again.

  8. #8
    Forum Expert
    Join Date
    12-29-2004
    Location
    Michigan, USA
    MS-Off Ver
    2013
    Posts
    2,208
    Are you saying that if the cell is cleared (deleted), then you don't want the user name to appear? If that is what you are asking:
    Please Login or Register  to view this content.

  9. #9
    Registered User
    Join Date
    05-06-2005
    Posts
    30
    That did the trick. You've just made my job about 1000% more efficient.

    Kudos to you

  10. #10
    Forum Expert
    Join Date
    12-29-2004
    Location
    Michigan, USA
    MS-Off Ver
    2013
    Posts
    2,208
    LOL! Glad I could help!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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