[英]Excel: How do I link to an external workbook always in the same directory?
I have file A.xlsx that has lookups to an external workbook called data.xlsx. 我有一个文件A.xlsx,它可以对名为data.xlsx的外部工作簿进行查找。 data.xlsx is generated by a script so always has the name data.xlsx and is generated in various places.
data.xlsx由脚本生成,因此始终具有名称data.xlsx并在不同位置生成。
I want to copy A to different places and always have the formula inside the workbook link to the data.xlsx generated in the same directory (as mentioned, data.xlsx is a file generated by a script so has different data inside each time). 我想将A复制到不同的位置,并且始终将工作簿中的公式链接到同一目录中生成的data.xlsx(如上所述,data.xlsx是由脚本生成的文件,因此每次内部都有不同的数据)。
My formula is something like this: =IFERROR(INDEX('C:\\Users\\andrew\\Test1[data.xlsx]sheet1'!$B$2:$AG$36, MATCH($C... 我的公式是这样的:= IFERROR(INDEX('C:\\ Users \\ andrew \\ Test1 [data.xlsx] sheet1'!$ B $ 2:$ AG $ 36,MATCH($ C ...
but this links to the specific file and gives me trouble when I copy A.xlsx to different places (it effectively remembers the path to the original data.xlsx). 但这链接到特定文件,并且在我将A.xlsx复制到不同位置时给我带来麻烦(它有效地记住了原始data.xlsx的路径)。
Is there a "CurrentDir" kind of way to do this, eg =IFERROR(INDEX('[CurrentDir][data.xlsx]sheet1'!$B$2:$AG... 有没有一种“ CurrentDir”方法,例如= IFERROR(INDEX('[CurrentDir] [data.xlsx] sheet1'!$ B $ 2:$ AG ...
so that I will always read a file data.xlsx that is in the same directory as A.xlsx? 这样我将始终读取与A.xlsx位于同一目录中的data.xlsx文件?
Current Dir is ./ 当前目录为./
'C:\\Users\\andrew\\Test1[data.xlsx]sheet1'!$B$2:$AG$36, MATCH($C... 'C:\\ Users \\ andrew \\ Test1 [data.xlsx] sheet1'!$ B $ 2:$ AG $ 36,MATCH($ C ...
should be : 应该 :
'[data.xlsx]sheet1'!$B$2:$AG$36, MATCH($C... '[data.xlsx] sheet1'!$ B $ 2:$ AG $ 36,MATCH($ C ...
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.