Link changes once the source file name is changed

mightyujin

New Member
Joined
Jun 15, 2011
Messages
12
Hi there, i have created a table that compares 2 data, one from this file called "daily_report.xls" and one where the table is, let's say "compare.xls". However i need to change "daily_report.xls" to "date_month.xls" i.e., "14_06.xls" once the comparison is done. I put a VBA that automatically saves to the designated file name, but the source code in the table also changes from
=SUM('C:\\Daily_LCY\[daily_report.xls]A&L'!$B:$Q)
to
=SUM('C:\\Daily_LCY\[14_06.xls]A&L'!$B:$Q).

I don't know how to make the formula to stay constant without changing the file name while the file only changes its name.

Any ideas?
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
How do you use indirect formula? I tried to use as
=SUM(INDIRECT('[daily_report.xls]A&L'!$B:$Q)) but it gives me #REF! error.
 
Upvote 0
A1 cell contains workbook name.

=SUM(INDIRECT("'C:\\Daily_LCY\" & A1 & "A&L'!$B:$Q")
 
Upvote 0
do you need to put file name in bracket?
i.e., [daily_report.xls] or just daily_report.xls?

mine does not work =/
 
Upvote 0
It is no use, once the quoted file name changes the file directory changes too. Indirect function changes as well, is there other ways to do it?
 
Upvote 0

Forum statistics

Threads
1,224,602
Messages
6,179,847
Members
452,948
Latest member
UsmanAli786

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