I have hundreds of shapes hyperlinked in numerous worksheets. The code below worked great to globally change the hyperlinks of all of these worksheets because I was only changing part of the hyperlink. How do I change these hyperlinks using a range of original hyperlinks (A2:A300), with a corresponding replacement range(B2:B300)?
Sub FixHyperlinks()
Dim wks As Worksheet
For Each Ws In Sheets
Ws.Activate
Dim hl As Hyperlink
Dim sOld As String
Dim sNew As String
Set wks = ActiveSheet
sOld = "part of old address"
sNew = "replacement to old address"
For Each hl In wks.Hyperlinks
hl.Address = Replace(hl.Address, sOld, sNew)
Next hl
Next Ws
End Sub
Thank you.