reference a cell with text (sheet name) so the V lookups work correctly

WillardNC

New Member
Joined
Mar 5, 2012
Messages
3
I have a sheet template that I have created to incorporate into various workbooks. This template sheet has a number of Vlookup formulas. The problem is that, when I insert my new template sheet into the current file, the formulas reference the old sheet in the old file. I would like to have one cell in my document (kind of like an anchor cell) where I could type in the name of the sheet where the data is contained. Then, have my vlookups incorporate that cell and the text was written applied to the formula.
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:eek:ffice:eek:ffice" /><o:p></o:p>
Example:
Cell O6 = Basic Unit Costs
<o:p></o:p>
Currently, the v lookup cell once imported into the workbook shows: =VLOOKUP(AA16,'Costs(Unit_Hours)'!$B:$BB,22,FALSE)
<o:p></o:p>
I want to have the v lookup formula use the text I write in cell O6 make the v lookup flow to the proper main sheet named cell as it is a REAL pain to change all the V lookups by hand..
<o:p></o:p>
V lookup =VLOOKUP(AA16,'__(Use O6 Text Here)__'!$B:$BB,22,FALSE)
I have tried using the Indirect formula but keep getting ref errors and name errors and pretty much all errors.
<o:p></o:p>
I want to be able to import my template sheet into my workbook, then type the name of the sheet that contains the sheet name into cell O6, then all the V lookups pull data from the correct sheet. Any thoughts?
<o:p></o:p>
I hope this makes sense.
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
Hi

You can use INDIRECT for this:

=VLOOKUP(AA16,INDIRECT("'" & O6 & "'!$B:$BB"),22,FALSE)

So you would place the entire sheet name in cell O6
 
Upvote 0
THANK YOU so much! I honestly did not think it would work becuase I have played around with the indirect function so much. I pasted the formula in and BAM! It flowed correctly. Thanks again!
 
Upvote 0

Forum statistics

Threads
1,216,127
Messages
6,129,024
Members
449,482
Latest member
al mugheen

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