Removing a link

Rickalty

New Member
Joined
Sep 16, 2002
Messages
3
I have a multi-sheet workbook in Excel. I copied a worksheet from another workbook into it, then deleted the other workbook. The sheet I copied over had a link to data on another page of the - now deleted - workbook. Now I can't get the link to refer to data in the current workbook. I tried going to "Edit" : "Links" and changing the source to be the current workbook, but it didn't work. How can I get rid of that external link completely ?

Thanks in advance.
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand

NateO

Legend
Joined
Feb 17, 2002
Messages
9,700
Howdy Richard, with some limited testing, I used the following code to remove the link portion of the formula, leaving the worksheet & cell reference of worksheet formulae:

<pre>
Sub Links()
Dim ws As Worksheet, cl As Range, frm As String, FrmCls As Range
Dim rplc As String, n As Integer, i As Integer
Application.DisplayAlerts = False
For Each ws In ActiveWorkbook.Worksheets
On Error Resume Next
Set FrmCls = ws.[a1].SpecialCells(xlFormulas)
If FrmCls Is Nothing Then GoTo 1
For Each cl In FrmCls
frm = cl.Formula
If InStr(frm, "]") And InStr(frm, ":") Then
i = InStr(frm, "]")
n = InStr(frm, ":")
rplc = Mid(frm, n - 1, i - (n - 2))
cl.Replace What:=rplc, Replacement:=""
End If
Next cl
1:
Set FrmCls = Nothing
Next ws
Application.DisplayAlerts = True
End Sub</pre>

Otherwise one may be looking at pasting as values or the MS file Barrie mentions at the following link:

http://www.mrexcel.com/board/viewtopic.php?topic=8267&forum=2

Never tried this file before, not sure what they mean when they say "delete."
 

Rickalty

New Member
Joined
Sep 16, 2002
Messages
3
Thanks for the replies, guys. Doing the "Insert" : "Name" : "Define" thing solved my problem.... the "phantom link" wasn't in a data containing cell - it was in the signature block where every page of my report says "Original Signature on File". On the one page that I'd copied over the link was to the defunct workbook. Thanks again.
 

Forum statistics

Threads
1,144,050
Messages
5,722,231
Members
422,417
Latest member
Johhny

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
Top