+ Reply to Thread
Results 1 to 5 of 5

Pulling Data from a list based on Username

  1. #1
    Forum Contributor
    Join Date
    06-18-2010
    Location
    USA
    MS-Off Ver
    Excel 2016
    Posts
    546

    Pulling Data from a list based on Username

    I have several different workbooks that I need to append a unique identifier (based off who opened it) to the end of the file name and save in a location on my local pc. I have the unique identifiers set, i have the save statement set, but I don't know in VBA how to set the references. Meaning let's say that if me (jo15765) opened workbook200 then I would need to search and find jo15765 = 45678, so the workbook would be saved in a location on my local PC with the filename of workbook200_45678. How can I reference a list of what usernames equal what identifiers? I know I could write multiple IF/Else statements or use Case statements. Are those the only options I have?

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Pulling Data from a list based on Username

    Hello jo15765,

    Are you saying that jo15765 is replaced by the number 45678 and you want a way to enter 45678 and return jo15765?
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Forum Contributor
    Join Date
    06-18-2010
    Location
    USA
    MS-Off Ver
    Excel 2016
    Posts
    546

    Re: Pulling Data from a list based on Username

    I was meaning that if the username that opened the workbook was JO15765 then I want to append the id 45678 to the end of the workbook name. There have been ID's assigned to all usernames, and it's a way of monitoring who is opening what workbook. So in the instance that someone finds the log file, they won't know whose ID is whose, but if we appended usernames then that would be very easily recognizable.

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Pulling Data from a list based on Username

    Hello jo15765,

    You can return the logged on User's ID this way...
    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    06-18-2010
    Location
    USA
    MS-Off Ver
    Excel 2016
    Posts
    546

    Re: Pulling Data from a list based on Username

    What about I try this approach....I created an access table with 3 fields, an autonumber, Name Field, and UniqueID field. How in VBA can I say, when the workbook is opened, take the userid that opened it, search the table (I am assuming I would have to build a query) and find the UniqueID and save the workbook with the UniqueID appended to the filename locally?

+ 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