Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Kill Active Links 1

Status
Not open for further replies.

sabascal

IS-IT--Management
Aug 20, 2002
85
GB
Hi all,
I have a spreadsheet full of active links.
How do I found and kill all active links in VBA?

Thanks,
Seb
 
links to itself or external links

ie

=Sheet1!A1
or
=[Workbook path & name]SheetName!A1

??

Rgds, Geoff
[blue]Si hoc signum legere potes, operis boni in rebus Latinus alacribus et fructuosis potiri potes![/blue]
Want the [red]best[/red] answers to your questions ? faq222-2244
 
External links, so "=[Workbook path & name]SheetName!A1"

Thanks,
Seb
 
If you don't have any other formulae, the easiest way is to copy / paste special values

other than that - this should get rid of external links:

Sub getridoflinks()
On Error Resume Next
application.screenupdating = false
application.calculation = xlcalculationmanual
With Worksheets("Sheet3").Cells 'use your worksheet name
Set c = .Find("='[", LookIn:=xlFormulas, lookat:=xlPart)
If Not c Is Nothing Then
firstAddress = c.Address
Do
c.Copy
c.PasteSpecial Paste:=xlPasteValues
Application.CutCopyMode = False
Set c = .FindNext(c)
Loop While Not c Is Nothing And c.Address <> firstAddress
End If
End With
application.screenupdating = true
application.calculation = xlcalculationautomatic
End Sub


Rgds, Geoff
[blue]Si hoc signum legere potes, operis boni in rebus Latinus alacribus et fructuosis potiri potes![/blue]
Want the [red]best[/red] answers to your questions ? faq222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top