VBA code to Modify Formula using new External Workbook Hyperlink

jgiltner

New Member
Joined
Sep 16, 2019
Messages
1
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.

Hyperlink ReferenceData Reference
WB 001.xlsx='C:\...\Desktop\[WB 001.xlsx]Sheet1'!$A$1
WB 002.xlsx^ want to copy this down and change [WB 001.xlsx] to [WB 002.xlsx]

<tbody>
</tbody>
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.

Forum statistics

Threads
1,213,484
Messages
6,113,920
Members
448,533
Latest member
thietbibeboiwasaco

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top