hi Jack,
Welcome to the Forum
Are you open to non-macro approaches...
Here are a couple of approaches which don't require any vba, although you could record a macro [alt + t + m + r] of your actions & then modify the recorded code. Note, the Recorder may record some unnecessary code which we can remove for you if you post a recorded macro.
1) How many different workbooks are linked?
If there aren't many, *, use Edit - Links & use change source on each of the files shown.
If there are lots, use the macro recorder to record a couple & post the code for them with explanation of the folder path structure (ie are they all in the same folder for each respective year?).
2) Turn your calculation to manual via Tools - Options - Calculation (esp if you have links to lots of files or lots of links), *, use find & replace (with Sheet/formula settings), & then REMEMBER to put your calculation back to how it was initially set.
*(It may help if you open the files that you want to change to, before trying either of these steps)
3) Lookup the Indirect function in Excel's help files. This function would allow you to use a cell reference to define the year. However, as the Help files state ,
the other workbook must be open. If the source workbook is not open, INDIRECT returns the #REF! error value.
and I'm not sure if this will suit your context...?
... I wrote the above a few hours ago before seeing your zipped files, & now that I've seen the files...
I can see there is only going to be one file referenced & the use of Indirect may be plausible. Would you be open to incorporating the data from the annual files on their own sheets within the Topology file?
If it is important for them to stay in separate files, I suggest adding two helper columns which will help limit the number of external references by moving the duplicated references into the helper columns ie:
- Insert 2 columns on the left of the sheet,
- in the new cell A5:
- in the new cell b5:
- in the new cell c5:
- in the new cell d5:
- in the new cell e5:
With this setup, you only have 2 fifths of the original amount of "external references" which will make it much easier to use indirect (or any of the other approaches).
hth
Rob
Bookmarks