ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   How do I have a formula lookup a sheetname? (https://www.excelbanter.com/excel-worksheet-functions/11000-how-do-i-have-formula-lookup-sheetname.html)

Mim

How do I have a formula lookup a sheetname?
 
I have a workbook with multiple worksheets.
Sheet 1: Has information needed to be retrieved and put into specific cells on
Sheet2.
Sheet 2: Col. A lists names of worksheets in workbook
In Col. B I want to write a formula that will lookup the
worksheet, using
the worksheet name in Col. A, then retrieve a value in a
specific cell on
that worksheet.

I don't want to "hardcode" the name of the worksheet in the formula (i.e.
'Sheet1'!H14), because that sheetname will always be changing.

Peo Sjoblom

You can use INDIRECT, assume A2 holds the sheet name

=INDIRECT("'"&A2&"'!H14")


Regards,

Peo Sjoblom

"Mim" wrote:

I have a workbook with multiple worksheets.
Sheet 1: Has information needed to be retrieved and put into specific cells on
Sheet2.
Sheet 2: Col. A lists names of worksheets in workbook
In Col. B I want to write a formula that will lookup the
worksheet, using
the worksheet name in Col. A, then retrieve a value in a
specific cell on
that worksheet.

I don't want to "hardcode" the name of the worksheet in the formula (i.e.
'Sheet1'!H14), because that sheetname will always be changing.


Mim

Awesome! That was much easier than I thought it would be!!!!!
Thanks

"Peo Sjoblom" wrote:

You can use INDIRECT, assume A2 holds the sheet name

=INDIRECT("'"&A2&"'!H14")


Regards,

Peo Sjoblom

"Mim" wrote:

I have a workbook with multiple worksheets.
Sheet 1: Has information needed to be retrieved and put into specific cells on
Sheet2.
Sheet 2: Col. A lists names of worksheets in workbook
In Col. B I want to write a formula that will lookup the
worksheet, using
the worksheet name in Col. A, then retrieve a value in a
specific cell on
that worksheet.

I don't want to "hardcode" the name of the worksheet in the formula (i.e.
'Sheet1'!H14), because that sheetname will always be changing.



All times are GMT +1. The time now is 01:01 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com