Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Use a lookup with a variable for the workbook name


I have a workbook and I have to use INDEX(...,MATCH(...)) into another
workbook that I have opened and it does not accept the code:
workbook is "2006 MasterMaterials.xls" with worksheet "RawMaterial"

cString = "2006 MasterMaterials.xls"

FormulaR1C1 = "=INDEX([cString]RawMaterial!$J:$J,
MATCH(C3,[cString]RawMaterial!$C:$C,0))"

Anyone have ideas???? I have tried a number of things.

Thanks


--
Wilbur
------------------------------------------------------------------------
Wilbur's Profile: http://www.excelforum.com/member.php...o&userid=31826
View this thread: http://www.excelforum.com/showthread...hreadid=515498

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Use a lookup with a variable for the workbook name

This won't work, but it gets you closer:

..FormulaR1C1 = "=INDEX([" & cString & "]RawMaterial!$J:$J," & _
"MATCH(C3,[" & cString & "]RawMaterial!$C:$C,0))"

But you've got another problem. .FormulaR1C1 wants the formula in R1C1
reference style.

Or maybe you want:

..Formula = "=INDEX([" & cString & "]RawMaterial!$J:$J," & _
"MATCH(C3,[" & cString & "]RawMaterial!$C:$C,0))"


Wilbur wrote:

I have a workbook and I have to use INDEX(...,MATCH(...)) into another
workbook that I have opened and it does not accept the code:
workbook is "2006 MasterMaterials.xls" with worksheet "RawMaterial"

cString = "2006 MasterMaterials.xls"

FormulaR1C1 = "=INDEX([cString]RawMaterial!$J:$J,
MATCH(C3,[cString]RawMaterial!$C:$C,0))"

Anyone have ideas???? I have tried a number of things.

Thanks

--
Wilbur
------------------------------------------------------------------------
Wilbur's Profile: http://www.excelforum.com/member.php...o&userid=31826
View this thread: http://www.excelforum.com/showthread...hreadid=515498


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 34
Default Use a lookup with a variable for the workbook name

Wilbur,

Take the variable cString out of the quotes. Try:

FormulaR1C1 = "=INDEX([" & cString & "]RawMaterial!$J:$J,MATCH(C3,[" &
cString & "]RawMaterial!$C:$C,0))"

HTH

Tim

"Wilbur" wrote in
message ...

I have a workbook and I have to use INDEX(...,MATCH(...)) into another
workbook that I have opened and it does not accept the code:
workbook is "2006 MasterMaterials.xls" with worksheet "RawMaterial"

cString = "2006 MasterMaterials.xls"

FormulaR1C1 = "=INDEX([cString]RawMaterial!$J:$J,
MATCH(C3,[cString]RawMaterial!$C:$C,0))"

Anyone have ideas???? I have tried a number of things.

Thanks


--
Wilbur
------------------------------------------------------------------------
Wilbur's Profile:

http://www.excelforum.com/member.php...o&userid=31826
View this thread: http://www.excelforum.com/showthread...hreadid=515498



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 34
Default Use a lookup with a variable for the workbook name


Oh! and it should start with something like:

Range("A4").Formula =

and not 'FormulaR1C1' when you use absolute cell references.

Tim

"Tim Barlow" wrote in message
...
Wilbur,

Take the variable cString out of the quotes. Try:

FormulaR1C1 = "=INDEX([" & cString & "]RawMaterial!$J:$J,MATCH(C3,[" &
cString & "]RawMaterial!$C:$C,0))"

HTH

Tim

"Wilbur" wrote in
message ...

I have a workbook and I have to use INDEX(...,MATCH(...)) into another
workbook that I have opened and it does not accept the code:
workbook is "2006 MasterMaterials.xls" with worksheet "RawMaterial"

cString = "2006 MasterMaterials.xls"

FormulaR1C1 = "=INDEX([cString]RawMaterial!$J:$J,
MATCH(C3,[cString]RawMaterial!$C:$C,0))"

Anyone have ideas???? I have tried a number of things.

Thanks


--
Wilbur
------------------------------------------------------------------------
Wilbur's Profile:

http://www.excelforum.com/member.php...o&userid=31826
View this thread:

http://www.excelforum.com/showthread...hreadid=515498





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
2 variable Lookup andrewevandc Excel Discussion (Misc queries) 1 May 15th 09 10:36 PM
Variable lookup Rod Excel Worksheet Functions 6 October 17th 08 02:27 PM
Lookup using variable name Rod Excel Worksheet Functions 1 October 17th 08 12:09 AM
3 variable lookup rooter Excel Worksheet Functions 6 May 10th 08 10:19 PM
Variable Lookup/Double Lookup Ryan[_2_] Excel Worksheet Functions 8 May 14th 07 09:44 PM


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