+ Reply to Thread
Results 1 to 5 of 5

Using Sheetname in Vlookup as the sheetname for the array to lookup

  1. #1
    Registered User
    Join Date
    06-05-2013
    Location
    Cleveland Ohio
    MS-Off Ver
    Excel 2003
    Posts
    3

    Using Sheetname in Vlookup as the sheetname for the array to lookup

    I have 2 workbooks: WorkbookA, WorkbookB

    Each Workbook has the same Sheetnames: Jan, Feb, Mar, etc...

    In workbookA, I want to use the following formula:

    VLOOKUP(Variable,[WorkbookB.xls]Jan!Truck_Schedule,MATCH(Date,[WorkbookB.xls]Jan!$N$5:$AS$5),0)

    Where it says "Jan" I would like to use the sheetname of the sheet where this formula is located.

    Something like: VLOOKUP(Variable,[WorkbookB.xls]SheetName!Truck_Schedule,MATCH(Date,[WorkbookB.xls]SheetName!$N$5:$AS$5),0)

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,427

    Re: Using Sheetname in Vlookup as the sheetname for the array to lookup

    You would use INDIRECT for this, which enables you to convert a string that represents a range reference into the actual reference, but this will only work if both workbooks are open in the same instance of Excel. Do you have a cell that contains SheetName?

    Pete

  3. #3
    Registered User
    Join Date
    06-05-2013
    Location
    Cleveland Ohio
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Using Sheetname in Vlookup as the sheetname for the array to lookup

    I do have a cell that contains the sheetname. However, I would need to be able to do this without WorksheetB being open. Any way to complete?

  4. #4
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,427

    Re: Using Sheetname in Vlookup as the sheetname for the array to lookup

    That is the limitation with INDIRECT.

    If you are prepared to download a free add-in (morefunc - do a Google search for site where you can download it from), then you could use the function INDIRECT.EXT, but for that to work you would need to supply the full path as well as the filename and sheet name.

    Hope this helps.

    Pete

  5. #5
    Registered User
    Join Date
    06-05-2013
    Location
    Cleveland Ohio
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Using Sheetname in Vlookup as the sheetname for the array to lookup

    It is a corporate environment that will not allow add-ins. Any other solution?

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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