rossnayrtorio
New Member
- Joined
- Apr 1, 2013
- Messages
- 2
I have created a macro to list all the links in a workbook, and it worked fine. Now I wanted to update it with the link in the second column beside the old link. It looks for example A4:A8 is where the old links are, and B4:B8 is where the new links are. I have written below macro to do what I wanted. However, it will take a while to run the macro and I will have to use task manager to stop it. Please see if I put something wrong with this. Thanks for the help!
Sub ReplaceLinks()
'
' Replace links in this workbook
'
Dim FromText As String
Dim ToText As String
Range("A4").Select
On Error Resume Next
Do
End Sub
Sub ReplaceLinks()
'
' Replace links in this workbook
'
Dim FromText As String
Dim ToText As String
Range("A4").Select
On Error Resume Next
Do
FromText = Activecell.Value
ToText = ActiveCell.Offset(0, 1).Value
ActiveWorkbook.ChangeLink Name:=FromText, NewName:=ToText, Type:=xlLinkTypeExcelLinks
ActiveCell.Offset(1, -1).Select
Loop Until Activecell = "" Or Activecell.Address = "A8"End Sub