i have a spreadsheet with links, i wish to remove these links but retain the infomation.
how can this be done?
i have a spreadsheet with links, i wish to remove these links but retain the infomation.
how can this be done?
If you also want to lose the worksheet formulas...
[vba]Option Explicit
'
Sub DeleteLinksAndFormulas()
With Cells
.Copy
.PasteSpecial Paste:=xlPasteValues
.Hyperlinks.Delete
End With
End Sub[/vba]
If you want to keep the other worksheet formulas, use...
[vba]Option Explicit
'
Sub DeleteLinksOnly()
Dim Cell As Range, FirstAddress As String, Temp As String
'
Application.ScreenUpdating = False
With ActiveSheet.UsedRange
Set Cell = .Find("=*!", LookIn:=xlFormulas, LookAt:=xlPart)
On Error GoTo Finish
FirstAddress = Cell.Address
Do
Temp = Cell
Cell.ClearContents
Cell = Temp
Set Cell = .FindNext(Cell)
Loop Until Cell Is Nothing Or Cell.Address = FirstAddress
.Hyperlinks.Delete
End With
Application.ScreenUpdating = True
End Sub[/vba]
You know you're really in trouble when the light at the end of the tunnel turns out to be the headlight of a train hurtling towards you
The major part of getting the right answer lies in asking the right question...
Made your code more readable, use VBA tags (this automatically inserts [vba] at the start of your code, and [/vba ] at the end of your code) | Help those helping you by marking your thread solved when it is.