Sub 替换超链接()
Dim sTobeReplaced As String
Dim sReplaceWith As String
sTobeReplaced = InputBox("输入你要查找的字符", "输入你要查找的字符")
sReplaceWith = InputBox("输入你要替换的字符", "输入你要替换的字符")
For Each Ws In Application.Worksheets '遍历工作表
For Each h In Ws.Hyperlinks '遍历超链接
If InStr(h.Address, sTobeReplaced) <> 0 Then
aLink = Replace(h.Address, sTobeReplaced, sReplaceWith)
h.Address = aLink
End If
Next
Next
End Sub
Dim sTobeReplaced As String
Dim sReplaceWith As String
sTobeReplaced = InputBox("输入你要查找的字符", "输入你要查找的字符")
sReplaceWith = InputBox("输入你要替换的字符", "输入你要替换的字符")
For Each Ws In Application.Worksheets '遍历工作表
For Each h In Ws.Hyperlinks '遍历超链接
If InStr(h.Address, sTobeReplaced) <> 0 Then
aLink = Replace(h.Address, sTobeReplaced, sReplaceWith)
h.Address = aLink
End If
Next
Next
End Sub