Hi,
I have a Workbook that serves as an aggregation of data from several other external workbooks (same file directory). The workbooks being referenced are all uniform, so the specific sheet and cell reference is always the same in a column with the only thing changing being the workbook name. Reference formulas are already built-out for 5 workbooks and will pull in the data appropriately when a workbook is added to the same folder and re-named using the generic serial identifier referenced in the formula ex. ='C:\...\Desktop\[WB 0001.xlsx.]Sheet1'$A$1. What I would like to do is use VBA code to pull-down the formulas and modify them to reference a new workbook when added. I am open to suggestions on how to efficiently do this. In my head, it seems like there should be a way to establish the hyperlink to the file once and then use VBA to copy the formulas using the new link as an input. I appreciate any help on the matter. Simplified example below.
Disclaimer: I have very limited VBA experience.
[TABLE="width: 500"]
<tbody>[TR]
[TD]Hyperlink Reference[/TD]
[TD]Data Reference[/TD]
[/TR]
[TR]
[TD]WB 001.xlsx[/TD]
[TD]='C:\...\Desktop\[WB 001.xlsx]Sheet1'!$A$1[/TD]
[/TR]
[TR]
[TD]WB 002.xlsx[/TD]
[TD]^ want to copy this down and change [WB 001.xlsx] to [WB 002.xlsx][/TD]
[/TR]
</tbody>[/TABLE]
I have a Workbook that serves as an aggregation of data from several other external workbooks (same file directory). The workbooks being referenced are all uniform, so the specific sheet and cell reference is always the same in a column with the only thing changing being the workbook name. Reference formulas are already built-out for 5 workbooks and will pull in the data appropriately when a workbook is added to the same folder and re-named using the generic serial identifier referenced in the formula ex. ='C:\...\Desktop\[WB 0001.xlsx.]Sheet1'$A$1. What I would like to do is use VBA code to pull-down the formulas and modify them to reference a new workbook when added. I am open to suggestions on how to efficiently do this. In my head, it seems like there should be a way to establish the hyperlink to the file once and then use VBA to copy the formulas using the new link as an input. I appreciate any help on the matter. Simplified example below.
Disclaimer: I have very limited VBA experience.
[TABLE="width: 500"]
<tbody>[TR]
[TD]Hyperlink Reference[/TD]
[TD]Data Reference[/TD]
[/TR]
[TR]
[TD]WB 001.xlsx[/TD]
[TD]='C:\...\Desktop\[WB 001.xlsx]Sheet1'!$A$1[/TD]
[/TR]
[TR]
[TD]WB 002.xlsx[/TD]
[TD]^ want to copy this down and change [WB 001.xlsx] to [WB 002.xlsx][/TD]
[/TR]
</tbody>[/TABLE]