#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default Vlookup

I have 10 sheets with different tables on each.
Using If and Vlookup I've exceded my 7 references.
What I would like is to be able to use the text data from a cell
to point to one of the 10 sheets. i.e. so that the cell data is named
the same as one of the sheets and Vlookup uses this in Table_array.

So if the value of cell A2="Wire"
Vlookup(C15,WireA1:C50,2) but if cell A3="Line"
then Vlookup(C15,LineA1:C50,2) etc
Many Thanks
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 364
Default Vlookup

If none of your sheet names contains any space character:
=VLOOKUP(C15,INDIRECT(A2&"!A1:C50"),2)
Or more generally:
=VLOOKUP(C15,INDIRECT("'"&A2&"'!A1:C50"),2)
(Note the apostrophe between the double quotes and another one before the
exclamation mark).

"Rolohound" wrote in message
...
I have 10 sheets with different tables on each.
Using If and Vlookup I've exceded my 7 references.
What I would like is to be able to use the text data from a cell
to point to one of the 10 sheets. i.e. so that the cell data is named
the same as one of the sheets and Vlookup uses this in Table_array.

So if the value of cell A2="Wire"
Vlookup(C15,WireA1:C50,2) but if cell A3="Line"
then Vlookup(C15,LineA1:C50,2) etc
Many Thanks



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,856
Default Vlookup

Try it like this:

=VLOOKUP(C15,INDIRECT("'"&A2&"'!A1:C50",2,0)

Hope this helps.

Pete

On Dec 20, 1:40 pm, Rolohound
wrote:
I have 10 sheets with different tables on each.
Using If and Vlookup I've exceded my 7 references.
What I would like is to be able to use the text data from a cell
to point to one of the 10 sheets. i.e. so that the cell data is named
the same as one of the sheets and Vlookup uses this in Table_array.

So if the value of cell A2="Wire"
Vlookup(C15,WireA1:C50,2) but if cell A3="Line"
then Vlookup(C15,LineA1:C50,2) etc
Many Thanks


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default Vlookup

Thankyou that worked exactly and should shorten the code considerably.
I've never used indirect before, but will look this function up as it seems
to be a very useful tool within excel.
Thanks once again.
Rolohound

"Stephen" wrote:

If none of your sheet names contains any space character:
=VLOOKUP(C15,INDIRECT(A2&"!A1:C50"),2)
Or more generally:
=VLOOKUP(C15,INDIRECT("'"&A2&"'!A1:C50"),2)
(Note the apostrophe between the double quotes and another one before the
exclamation mark).

"Rolohound" wrote in message
...
I have 10 sheets with different tables on each.
Using If and Vlookup I've exceded my 7 references.
What I would like is to be able to use the text data from a cell
to point to one of the 10 sheets. i.e. so that the cell data is named
the same as one of the sheets and Vlookup uses this in Table_array.

So if the value of cell A2="Wire"
Vlookup(C15,WireA1:C50,2) but if cell A3="Line"
then Vlookup(C15,LineA1:C50,2) etc
Many Thanks




  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 364
Default Vlookup

You may wish to look here for a good description of how to use INDIRECT:
http://www.cpearson.com/excel/indirect.htm

"Rolohound" wrote in message
...
Thankyou that worked exactly and should shorten the code considerably.
I've never used indirect before, but will look this function up as it
seems
to be a very useful tool within excel.
Thanks once again.
Rolohound

"Stephen" wrote:

If none of your sheet names contains any space character:
=VLOOKUP(C15,INDIRECT(A2&"!A1:C50"),2)
Or more generally:
=VLOOKUP(C15,INDIRECT("'"&A2&"'!A1:C50"),2)
(Note the apostrophe between the double quotes and another one before the
exclamation mark).

"Rolohound" wrote in message
...
I have 10 sheets with different tables on each.
Using If and Vlookup I've exceded my 7 references.
What I would like is to be able to use the text data from a cell
to point to one of the 10 sheets. i.e. so that the cell data is named
the same as one of the sheets and Vlookup uses this in Table_array.

So if the value of cell A2="Wire"
Vlookup(C15,WireA1:C50,2) but if cell A3="Line"
then Vlookup(C15,LineA1:C50,2) etc
Many Thanks






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Vlookup in vlookup - taking the result as array name SupperDuck Excel Worksheet Functions 2 June 2nd 07 11:05 AM
Combine VLOOKUP and IF function so #NA isn't returned as a value from VLOOKUP buffgirl71 Excel Discussion (Misc queries) 12 November 14th 06 11:36 PM
Vlookup -=VLOOKUP(F9,LookUp1!$A$2:$B$1504,2,FALSE) MikeR-Oz New Users to Excel 1 March 22nd 06 09:01 AM
IF(AND(val1=VLOOKUP( );val2>=VLOOKUP( );val2<=VLOOKUP( );VLOOKUP( Oso Excel Worksheet Functions 2 January 26th 05 06:56 AM
Vlookup info being used without vlookup table attached? Excel Worksheet Functions 0 January 25th 05 10:43 AM


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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"