Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 9
Default Dynamic Sheet Name in Vlookup

I have a table that is doing some vlookups from another workbook. The
problem i have is that for each column the worksheet name is named
differently. So, basically I have data a table like the one below:

HU SS PL .....
1
2
3
4


Under the HU column, the vlookup needs to pull from the HUTP
worksheet. Under the SS column, it needs to pull from the SSTP
worksheet, etc.

=VLOOKUP($A3,'S:\mfg\CFM\Reports\TOC_Reports\[Targets.xls]HUTP'!$H
$8:$IV$187,12,FALSE)

Any ideas on how to do this without having to change the sheet in
every column and instead pull it from the column header? IE, I want a
function that looks something like this (but this obviously doesn't
work):

=VLOOKUP($A2,'S:\mfg\CFM\Reports\TOC_Reports\[Targets.xls](A$1 &
"TP")'!$H$8:$IV$187,2,FALSE)

Thanks in advance.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,441
Default Dynamic Sheet Name in Vlookup

John,

Try

=VLOOKUP($A3,INDIRECT("'S:\mfg\CFM\Reports\TOC_Rep orts\[Targets.xls]" & A$1 &
"TP'!$H$8:$IV$187"),12,FALSE)

HTH,
Bernie
MS Excel MVP


"John" wrote in message
...
I have a table that is doing some vlookups from another workbook. The
problem i have is that for each column the worksheet name is named
differently. So, basically I have data a table like the one below:

HU SS PL .....
1
2
3
4


Under the HU column, the vlookup needs to pull from the HUTP
worksheet. Under the SS column, it needs to pull from the SSTP
worksheet, etc.

=VLOOKUP($A3,'S:\mfg\CFM\Reports\TOC_Reports\[Targets.xls]HUTP'!$H
$8:$IV$187,12,FALSE)

Any ideas on how to do this without having to change the sheet in
every column and instead pull it from the column header? IE, I want a
function that looks something like this (but this obviously doesn't
work):

=VLOOKUP($A2,'S:\mfg\CFM\Reports\TOC_Reports\[Targets.xls](A$1 &
"TP")'!$H$8:$IV$187,2,FALSE)

Thanks in advance.



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 9
Default Dynamic Sheet Name in Vlookup

On Jun 5, 10:22*am, "Bernie Deitrick" <deitbe @ consumer dot org
wrote:
John,

Try

=VLOOKUP($A3,INDIRECT("'S:\mfg\CFM\Reports\TOC_Rep orts\[Targets.xls]" & A$1 &
"TP'!$H$8:$IV$187"),12,FALSE)

HTH,
Bernie
MS Excel MVP

"John" wrote in message

...



I have a table that is doing some vlookups from another workbook. *The
problem i have is that for each column the worksheet name is named
differently. *So, basically I have data a table like the one below:


* * *HU * * SS * * PL * *.....
1
2
3
4


Under the HU column, the vlookup needs to pull from the HUTP
worksheet. *Under the SS column, it needs to pull from the SSTP
worksheet, etc.


=VLOOKUP($A3,'S:\mfg\CFM\Reports\TOC_Reports\[Targets.xls]HUTP'!$H
$8:$IV$187,12,FALSE)


Any ideas on how to do this without having to change the sheet in
every column and instead pull it from the column header? *IE, I want a
function that looks something like this (but this obviously doesn't
work):


=VLOOKUP($A2,'S:\mfg\CFM\Reports\TOC_Reports\[Targets.xls](A$1 &
"TP")'!$H$8:$IV$187,2,FALSE)


Thanks in advance.- Hide quoted text -


- Show quoted text -


It gives me a #REF error when I try to use it. Even tried just using
indirect to return set cell and was unable to do so.
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4,624
Default Dynamic Sheet Name in Vlookup

To use INDIRECT() the target workbook needs to be open.

In article
,
John wrote:

It gives me a #REF error when I try to use it. Even tried just using
indirect to return set cell and was unable to do so.

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 9
Default Dynamic Sheet Name in Vlookup

On Jun 5, 12:47*pm, JE McGimpsey wrote:
To use INDIRECT() the target workbook needs to be open.

In article
,



*John wrote:
It gives me a #REF error when I try to use it. *Even tried just using
indirect to return set cell and was unable to do so.- Hide quoted text -


- Show quoted text -


Ah, that's the problem then. Anyway to do it without having the
workbook open?


  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,441
Default Dynamic Sheet Name in Vlookup

John,

You can use a macro to create formulas that link to the file based on the
values of the headers cells - or you can simply copy the formula and edit
it to include the new worksheet name.

Bernie

"John" wrote in message
...
On Jun 5, 12:47 pm, JE McGimpsey wrote:
To use INDIRECT() the target workbook needs to be open.

In article
,



John wrote:
It gives me a #REF error when I try to use it. Even tried just using
indirect to return set cell and was unable to do so.- Hide quoted text -


- Show quoted text -


Ah, that's the problem then. Anyway to do it without having the
workbook open?


  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 9
Default Dynamic Sheet Name in Vlookup

On Jun 5, 5:59*pm, "Bernie Deitrick" <deitbe @ consumer dot org
wrote:
John,

You can use a macro to create formulas that link to the file based on the
values of the headers cells - or *you can simply copy the formula and edit
it to include the new worksheet name.

Bernie

"John" wrote in message

...
On Jun 5, 12:47 pm, JE McGimpsey wrote:

To use INDIRECT() the target workbook needs to be open.


In article
,


John wrote:
It gives me a #REF error when I try to use it. Even tried just using
indirect to return set cell and was unable to do so.- Hide quoted text -


- Show quoted text -


Ah, that's the problem then. *Anyway to do it without having the
workbook open?


OK. Was hoping to avoid having to do either of those two but it
appears it's down to that. Thanks for the help.
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 using a dynamic range CSK Excel Discussion (Misc queries) 1 October 23rd 07 04:00 AM
vlookup with dynamic table_array Jim Toohey Excel Worksheet Functions 3 November 10th 06 10:46 PM
dynamic vlookup? Ray Excel Worksheet Functions 3 November 3rd 06 11:49 AM
Dynamic column chart - copying from Sheet to Sheet. Marko Pinteric Excel Discussion (Misc queries) 1 April 10th 06 12:57 PM
Dynamic column chart - copying from Sheet to Sheet. Marko Pinteric Charts and Charting in Excel 1 April 10th 06 12:57 PM


All times are GMT +1. The time now is 02:10 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"