Solved

Referencing Another Tab Based on a Cell Value

Posted on 2013-11-08
6
183 Views
Last Modified: 2013-11-08
Hi I've inherited a spreadsheet with multiple tabs.   I am trying to break out the individual columns to individual tabs and then tie it into a backend.  I have the macro established to break it out into the individual tabs but am stumped on how to tie the backend into the individual tabs.  

I was wondering if there is a way to use a cell value to lead into the appropiate tab for a HLookup?

Thanks.
0
Comment
Question by:mattfmiller
6 Comments
 
LVL 12

Expert Comment

by:Harry Lee
ID: 39634211
It really depends on what cell value you are referring to.

With If statement, and nested If statements, you can for sure do some sort of selection between which tab is used for the HLookup.

That also said, for sure you can do it in VBA.

What's the rule on which tab to use as the cell value change?
0
 
LVL 23

Expert Comment

by:NBVC
ID: 39634216
You can refer to a tab indirectly through a cell value using the INDIRECT() function

e.g. if you have a sheet named, MySheet, and you have a cell in the activesheet with text string in it as MySheet,  then you can reference that as =INDIRECT("'"&A1&"'!A1:A100)

this will refer to sheet shown in cell A1 and look at range A1:A100 in that sheet.
0
 
LVL 1

Author Comment

by:mattfmiller
ID: 39634298
I think I'm partway there but I'm getting a reference error.

=HLOOKUP(E1,INDIRECT("'"&E2) & "!$B$1:$AZ$1000",2,0)
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 23

Accepted Solution

by:
NBVC earned 225 total points
ID: 39634335
Try:

=HLOOKUP(E1,INDIRECT("'"&E2&"'!$B$1:$AZ$1000"),2,0)
0
 
LVL 43

Assisted Solution

by:Saqib Husain, Syed
Saqib Husain, Syed earned 225 total points
ID: 39634340
Try

=HLOOKUP(E1,INDIRECT("'"&E2 & "'!$B$1:$AZ$1000"),2,0)
0
 
LVL 1

Author Closing Comment

by:mattfmiller
ID: 39634358
Thank you very much.  This is exactly what I needed.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Approximate matching with VLOOKUP and MATCH seems to me to be a greatly under-used technique, and one which is vital for getting good performance out of large lookups. Until recently I would always have advised using an exact match for simplicity an…
Improved? Move/Copy Add-in Replacement - How to avoid the annoying, “A formula or sheet you want to move or copy contains the name XXX, which already exists on the destination worksheet.” David Miller (dlmille)  It was one of those days… I wa…
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now