I have a database of hundreds of hyperlinks which direct to the location of file:///\My002vs0026\Department\"file name".
I wish to change the initial part "My002..0026" to "My002..0095"
I used the following codes which found on the net. When run, nothing happens.
Sub ChangeHyperlinks()
Dim h As Hyperlink
Dim oldDr As String, newDr As String
oldDr = "my002vs0026"
newDr = "my002vs0095"
For Each h In Sheets("Sheet1").Hyperlinks
h.Address = newDr & Mid(h.Address, Len(oldDr) + 1, Len(h.Address))
Next h
End Sub
Maybe there is any other solution to change the hyperlinks location.