Linking Workbooks

  • Thread starter Thread starter Josh
  • Start date Start date
J

Josh

Is it possible to link to a workbook "A" without knowing
the filename of the workbook "A"? The file name would be
inputted into a cell (not a formula) in workbook "B" by
the user.
 
You could be asking about using INDIRECT() ..

Try this example:

Let's open 2 new books, Book1.xls and Book2.xls

In Book1.xls, in Sheet1
--------------------------------
Enter the value "99" in B1

In Book2.xls, in Sheet1
---------------------------------
Enter the following values in cells:

B1: Book1
C1: Sheet1
D1: B1

Put in say B2: =INDIRECT("["&B1&"]"&C1&"!"&D1)

B2 will return "99"
(the value in B1 in Sheet1 of Book1.xls)

The use of INDIRECT() above is functionally equivalent
to having in B2: =[Book1]Sheet1!B1

but with the flexibility of defining in cells B1:C1
the filename, the sheetname, and the cell reference
that is desired, either via manual input
or formula returns in cells B1:C1

Note: The source Book1.xls must be concurrently open
with Book2.xls for INDIRECT() to work
 
Back
Top