Break Links But Leave Formula

toe222

Board Regular
Joined
Feb 5, 2004
Messages
143
Ok I need to know how using VB how to open 500 workbooks and break all links to another workbook but leave the rest of the formula. I know how to loop thru all files but not remove the link reference.

=+'[Book1]Sheet1'!A1
needs to be
=Sheet1'!A1

I tried the below but it did not work.
For Each scrFile In scrFolder.Files
strName = scrFile.Name
Workbooks.Open (scrFile)
Cells.Replace What:="[Book1]", Replacement:=""
Activeworkbook.Close (True)
Next scrFile

Any help someone could give would be greatly appreciated cause I do not want to manually do the find and replace method.
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.

Forum statistics

Threads
1,213,492
Messages
6,113,967
Members
448,537
Latest member
Et_Cetera

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