Workbook Links

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I would like to simply find which cells in my spreadsheet have links to
another workbook. What can I do to identify the address of cells that have
links to an external workbook. Thanks, Jim
 
There's got to be an easier way than this, but I'd look for [ or ] in the
cells.
 
Here's another macro that will find all external links in the workbook.


Sub FindLink()
Dim Report As Object
Set Report = Sheets.Add
Dim LinkList As Variant
Dim LinkPath As Variant

LinkList = ActiveWorkbook.LinkSources(xlExcelLinks)
If Not IsEmpty(LinkList) Then
For i = 1 To UBound(LinkList)
LinkPath = Split(LinkList(i), "\", -1, vbTextCompare)
For Each x In Worksheets
If x.Name <> Report.Name Then
For Each y In x.UsedRange
If InStr(1, y.Formula, LinkPath(UBound(LinkPath)), vbTextCompare) > 0
Then
Report.Select
ActiveCell.Value = x.Name & y.Address
ActiveCell.Offset(0, 1).Value = LinkList(i)
ActiveCell.Offset(1, 0).Select
End If
Next y
End If
Next x
Next i
End If

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top