Linking cells from different workbooks?

SPIVA2146

New Member
Joined
Jun 20, 2008
Messages
2
I am trying to link the same cells with different workbooks. I want to be able to only have to change the link for the workbook, and leave the cell references the same.
I could put in: ='c:\database[file1.xls]Sheet1'!C15
for each cell, that works.
but I want to reference different files; file1, file2, file3 etc.
This is what i've got so far
A1='c:\database[file1.xls]sheet1'
A2=!C15
A3=!C16
A4=!C17
B1='c:\database[file2.xls]sheet1'
B2=!C15
B3=!C16
B4=!C17

I hope this makes sence...
Any help would be great!!!

Thanks
spiva
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.

Banker1

Active Member
Joined
Mar 10, 2005
Messages
463
Try the INDIRECT function:

Something like this:

A1="c:\database"&indirect($A$1)&"sheet1"
A2=!C15
A3=!C16
A4=!C17
B1='c:\database"&indirect($B$1)&"sheet1"
B2=!C15
B3=!C16
B4=!C17

Where A1 and B1 contain the text file1.xls and file2.xls, respectively. Update accordingly.
 
Upvote 0

SPIVA2146

New Member
Joined
Jun 20, 2008
Messages
2
I couldn't get the INDIRECT function to work.
I'm sorry, I left out one thing in my example.

A1='c:\database[file1.xls]sheet1'
A2=(A1)!C15
A3=(A1)!C16
A4=(A1)!C17
B1='c:\database[file2.xls]sheet1'
B2=(B1)!C15
B3=(B1)!C16
B4=(B1)!C17
 
Upvote 0

Banker1

Active Member
Joined
Mar 10, 2005
Messages
463
Looking back at what I originally suggested... file1.xls and file2.xls should look like [file1.xls] and [file2.xls] (forgot the brackets). Give that a shot.
 
Upvote 0

Banker1

Active Member
Joined
Mar 10, 2005
Messages
463
Upon further reading I found this:

http://www.contextures.com/xlFunctions05.html

Create a Reference To a Different Workbook is towards the bottom of the pages and says, "An INDIRECT formula can refer to cells in other workbooks, but will return a #REF! error if that workbook is closed." so my suggestion probably isn't the best method to achieve what you're trying to do.
 
Upvote 0

Forum statistics

Threads
1,191,171
Messages
5,985,067
Members
439,938
Latest member
MAlhash

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top