+ Reply to Thread
Results 1 to 4 of 4

VLOOKUP - Refrencing a self-generated workbook name?

  1. #1
    Registered User
    Join Date
    05-23-2016
    Location
    The Shire
    MS-Off Ver
    365
    Posts
    2

    Wink VLOOKUP - Refrencing a self-generated workbook name?

    Hello!

    Okay, I need advice. I'm working on sort of template in excel used to pull data from several other workbooks.

    Every workbook has its own name that follows a certain format. For example, "S2_BUILDING_ROOM.xlsb" and the part that changes is "BUILDING" and "ROOM." So long story short the template uses ="S2_"&N10&"_"&O10&".xlsb" to create a cell that says "S2_BUILDING_ROOM.xlsb". N10 and O10 are lookup formulas to grab the building name and room number. I want to make a formula that will look at this cell and pick up data from specific cell. It would look like "=[S2_BUILDING_ROOM.xlsb]Sheet1$C$33" only instead of entering "S2_building_room.xlsb" manually, I want to use the cell that generates this ID.

    The reason for this is that I'm trying to automate a lot of work. On one page I put in the BUILDING#, and then each additional sheet will automatically generate its own ROOMID, then grab the appropriate data.

    Does this make any sense?

    Thanks!

  2. #2
    Valued Forum Contributor loginjmor's Avatar
    Join Date
    01-31-2013
    Location
    Cedar Rapids, Iowa
    MS-Off Ver
    Excel 2013
    Posts
    1,073

    Re: VLOOKUP - Refrencing a self-generated workbook name?

    Hi -

    I'm not sure I completely follow what you are trying to do. Could you post a sample spreadsheet with any sensitive data removed, and an example or two of your desired outcome?
    ____________________________________________
    If this has solved your problem, please edit the thread title to add the word [SOLVED] at the beginning. You can do this by
    -Go to the top of the first post
    -Select Thread Tools
    -Select Mark thread as Solved

    If I have been particularly helpful, please "bump" my reputation by pressing the small star in the lower left corner of my post.

  3. #3
    Registered User
    Join Date
    05-23-2016
    Location
    The Shire
    MS-Off Ver
    365
    Posts
    2

    Re: VLOOKUP - Refrencing a self-generated workbook name?

    Posting an example is a little more complicated because the workbook is linked to several other workbooks, but I'll see if I can be a little more specific.

    Okay, so for this project I've sampled 4 rooms in 40 buildings. I'm building a workbook that will summarize the data for each building, and I'm trying to automate it. Every building has an ID number, BUILDING1, BUILDING2, etc. And in that building each room is ROOM1, ROOM2, etc.. The way I have it set up, the workbook has 5 tabs. A Building, Room1, Room2, Room3, Room4. I put in the BUILDING# on the building tab, and then the ROOM tabs generate their own ID by this formula: "=(Building!Q5&"_"&L4" (L4 says ROOM1 on page Room1, ROOM2 on page Room2, etc.) So the result is "BUILDING#_ROOM#". Lets call this ID cell "B2". Then there are other cells that will reference the cell B2 to VLOOKUP another piece of data... "=VLOOKUP(B2,....)" This works fine because B2 is just a reference point inside another workbook, the table_array (F:\folder\....[...]) is the same for all classrooms.

    Now, I have 200 workbooks that are all separately named, but structured exactly the same. I need each one of these ROOM tabs to look at C48 and report that value. So what I've done is create the name of the file using the "&""&" formula. Lets say Cell A1 is looking up the building number, and cell B1 is looking up the Room number, so C1 is putting them together to make S2_ (this is just a random prefix that they all have) S2_BUILDING#_ROOM#.xlsb. Can I make a lookup that will reference C1 for the workbook name and pull C48 from it? So it will basically be =[C1]Sheet1$C$48 where C1= "S2_"&A1&"_"&B1&".xlsb" => (which in the cell reads S2_BUILDING#_ROOM#)

  4. #4
    Valued Forum Contributor loginjmor's Avatar
    Join Date
    01-31-2013
    Location
    Cedar Rapids, Iowa
    MS-Off Ver
    Excel 2013
    Posts
    1,073

    Re: VLOOKUP - Refrencing a self-generated workbook name?

    Hi -

    This is a little tougher than it looks. The INDIRECT formula returns a cell reference from a text string. For example, =INDIRECT($C$1&"Sheet1$C$48") would return whatever is stored at that cell reference as long as that workbook is open. But if you are working with 200 workbooks, I doubt you want to open them every time you want to refresh the data.

    So, there is a VBA workaround you can copy and paste into your worksheet located at:

    https://www.experts-exchange.com/que...workbooks.html

    Hope that helps.

+ 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. [SOLVED] Running a macro in a generated/unsaved WorkBook
    By bibu in forum Excel General
    Replies: 4
    Last Post: 02-12-2016, 03:37 AM
  2. [SOLVED] Get data from closed SAP generated .xls workbook
    By Villalobos in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-09-2015, 06:31 AM
  3. Copy specific data from Monthly auto generated workbook to master sheet
    By onbeillp111 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 03-26-2014, 12:25 PM
  4. Creating folder and filter and copy paste to a new workbook generated
    By kriahnadas.oo7 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-08-2014, 06:01 AM
  5. Selecting Auto-generated workbook?
    By JohnathanC in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-15-2010, 04:36 PM
  6. how can I paste to a different workbook without formula refrencing the origi
    By arunkumar.narayanan@gmail.com in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 05-29-2006, 06:55 AM
  7. [SOLVED] Referencing 0 generated from IF(isna(Vlookup) formula
    By DA@PD in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-14-2005, 06:20 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