Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

difficulty linking to workbooks

Status
Not open for further replies.

zerod

Technical User
Feb 1, 2002
13
CA
Here's what I want to do:

In column A, I enter the file name of an excel document (without the .xls filename extension) that contains the data I want. Then, I want column B to be able to read the filename I have entered in column A, and go to that file and get information from a specific cell. I can't figure out how to get one cell to read a filename from another cell.

Any help is greatly appreciated.

zerod
 
Hi,
How do you know what worksheet in that workbook?

If you do then the INDIRECT() function might work...
Code:
=INDEX(INDIRECT("["&A1&".xls]"&B1&"!"&C1),1)
where A1 has your workbook name
B1 has your sheet name
C1 has the Cell Range

It returns the value out of the FIRST ROW.

Hope this helps :) Skip,
metzgsk@voughtaircraft.com
 
That line you gave me works, but my sheet name and cell range are always constant. Is there any way to tell it to go to Sheet1 at cell D15 directly in the equation/function, without entering Sheet1 in cell B1, and D15 in cell C1?

Thanks for the help.

zerod
 
x$ = Cells(1, 2) '**** The cell that is typed into...I'd recomend a
'data validation drop down for this!
Cells(1, 1).FormulaR1C1 = "='" + x$ + "'!R3C3" 'puts value from "C3", in X$ workbook into A1
 
duh

=INDEX(INDIRECT("["&A1&".xls]Sheet1!A1:A999"),1) Skip,
metzgsk@voughtaircraft.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top