r/excel•
Compactsun

Referring to a file path contained in a cell rather than updating an entire sheet

solved

Come into an environment where a worksheet is essentially copied into another one which pulls and formats the data correctly for uploading. Issue is that every half year the worksheet that is copied changes name so I have to update tens of thousands of rows with the new spreadsheet name.

I want to record the name of the spreadsheet I'm copying into one cell and then refer to that so I only need to update one cell vs tens of thousands. Is there a way to do that? Things I've tried have come up with errors and my google-fu is unfortunately not providing this specific answer.

As an example it's currently: filepath[sheetname]A1 and so on in every cell

But I want to record 'filepath[sheetname]' to a cell instead and reference that (say cell B1).

Posted Jan 19, 2020, 1:23 PM UTC

56
small_trunks735•

There are ways to use INDIRECT - but it'll be slow for almost zero benefit in this case.

You can effectively "Change source" in one go by going to DATA -> Data Links, click your workbook and say change source...

2
CompactsunOP•

Solution Verified

2
Clippy_Office_AsstMOD•

You have awarded 1 point to small_trunks

^I ^am ^a ^bot, ^please ^contact ^the ^mods ^for ^any ^questions.

1
sonomodata17•

(https://support.office.com/en-us/article/break-a-link-to-an-external-reference-in-excel-f1ca8b08-4f24-4af6-92e5-f4fdb1442748)

If you use the Edit Link function, you can just change the link from File Path A to File Path B. Even if you have 1,000,000 cells with formulas, if they are all referencing cells from File Path A, Excel will recognize that the workbook is only linking to one other file at File Path A. When you can it to File Path B, all the formulas will update accordingly.

2
CompactsunOP•

Solution Verified

2
Clippy_Office_AsstMOD•

You have awarded 1 point to sonomodata

^I ^am ^a ^bot, ^please ^contact ^the ^mods ^for ^any ^questions.

1
[deleted]•

[deleted]

1
[deleted]•

[deleted]

1