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

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
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
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
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
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,214,920
Messages
6,122,264
Members
449,075
Latest member
staticfluids

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
Back
Top