This can be achieved using a named range and a custom function in PowerQuery:
- Name the cell you need to refer (type in a name into the file left of the formula bar) - e.g.
SourceFile
- Insert a new blank PowerQuery query (PowerQuery ribbon -> From other sources)
- In the PowerQuery editor, go to View -> Advanced Editor and paste the following code;
(rangeName) =>
Excel.CurrentWorkbook(){[Name=rangeName]}[Content]{0}[Column1]
- Name the query to
GetValue
(Name property in the Query settings pane on the right)
Now you can access the named cell in your queries, using GetValue(cellName)
- e.g.
= Excel.Workbook(File.Contents(GetValue("SourceFile")))
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…