How to refer to a worksheet name ?

xiaojo

New Member
Joined
May 16, 2003
Messages
3
I want to refer to a worksheet name that will be specified by user, i will be using a formula something like vlookup, currently i can select the cells for that formula.. but i need to make the sheet name become flexible to user. is there anyway to do that?
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
WELCOME TO THE BOARD!

This formula will return the sheet name:

=MID(CELL("filename"),SEARCH("]",CELL("filename"))+1,LEN(CELL("filename"))-SEARCH("]",CELL("filename")))
 
Upvote 0
Say your normal formula on Sheet1 returns the value from cell B1 on Sheet 2, like this:

='Sheet 2'!B1

If cell A1 on Sheet1 contains "Sheet 2" (no quotes) you can use this:

=INDIRECT("'"&$A$1&"'!B1")

so that the sheet to be used is a variable.

One problem with this method is that cell reference (the B1 part) will not adjust automatically when you copy the formula, because it is just a text string.
 
Upvote 0

Forum statistics

Threads
1,221,709
Messages
6,161,431
Members
451,705
Latest member
Priti_190

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top