+ Reply to Thread
Results 1 to 5 of 5

Thread: Function to pick up sheet names

  1. #1
    Registered User
    Join Date
    02-04-2010
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    18

    Function to pick up sheet names

    Hiya I have a workbook with a summary page that lists various data from the other sheets in the workbook. I have the sheet names listed on the summary page using VBA, and now want to ruse VLookup to reference the listed hseet names and return the data.

    For instance the list of sheet names is in Col A, and in Col B is the following formula:
    =VLOOKUP("Hours",SHEETNAME!A1:B6,100,FALSE) where SHEETNAME is got by manually typing in the worksheet name - I would instead like to reference the sheet names in Col A.

    Hope that makes sense,

    Thanks in advance
    Nina
    Last edited by boatbabe; 08-24-2011 at 04:56 PM.

  2. #2
    Valued Forum Contributor
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    1,958

    Re: Function to pick up sheet names

    If your sheet name is in, say, cell A1 you could use:

    =VLOOKUP("Hours",INDIRECT("'" & A1 & "'!A1:B6"),100,FALSE)

    Does that help?

  3. #3
    Registered User
    Join Date
    02-04-2010
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    18

    Re: Function to pick up sheet names

    Quote Originally Posted by Andrew-R View Post
    If your sheet name is in, say, cell A1 you could use:

    =VLOOKUP("Hours",INDIRECT("'" & A1 & "'!A1:B6"),100,FALSE)

    Does that help?
    That seems to work, thank you. I do have a REF issue but not sure what it is relating to, have studied the formula for ages but can not see an error in it. For some reason I can't upload the zip file but if anyone can see the error here I would be grateful
    =VLOOKUP(J1,INDIRECT("'"&A5&"'!b129:ea163"),MATCH(C4,INDIRECT("'"&A5&"'!cw7:ea7",0),FALSE))
    Thanks

  4. #4
    Valued Forum Contributor
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    1,958

    Re: Function to pick up sheet names

    You haven't closed off the INDIRECT bracket in the match statement.

    Try:

    =VLOOKUP(J1,INDIRECT("'"&A5&"'!b129:ea163"),MATCH(C4,INDIRECT("'"&A5&"'!cw7:ea7"),0),FALSE))

  5. #5
    Registered User
    Join Date
    02-04-2010
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    18

    Re: Function to pick up sheet names

    I knew it was an obvious one, thank you very much :-)

+ 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.2.0