Ia inlocuieste in codul ala:
H.Address = stReplace & Mid(H.Address, Len(stFind) + 1)
cu
H.Address = stReplace & Mid(H.Address, 58)
Desi, e tot al drak cu ce e mai sus. Ar trebui sa mearga
Zi-mi cum arata la tine un hyperlink, cum ar trebui sa arate, si ce bagi tu in casutele replace what si replace with.
Desi nu am facut VB in viata mea, incerc sa o iau logic, si sa modific un pic algoritmul ala:
Cod:
Sub ReplaceHyperlinksInActiveWorkbook()
Dim oSheet As Object
Dim H As Hyperlink
Dim stFind As String
Dim stReplace As String
stFind = InputBox("What is the initial path to replace?", , "\\Old\")
If stFind = "" Then Exit Sub
stReplace = InputBox("What should the path become?", , "\\New\")
If stReplace = "" Then Exit Sub
For Each oSheet In ActiveWorkbook.Sheets
For Each H In oSheet.Hyperlinks
If InStr(H.Address, stFind) = 1 Then
H.Address = Replace(H,Address, stFind, stReplace)
End If
Next
Next
End Sub
Ia vezi cu asta?