使用宏来实现是最简单有效的。
执行时根据提示先输入被替换的链接,再输入替换成的链接,轻松替换~
Sub ReplaceLink()
'
' ReplaceLink Macro'
'
Dim sTobeReplaced As String
Dim sReplaceWith As String
sTobeReplaced = InputBox('What link content to be replaced?', 'What link content to be replaced')
sReplaceWith = InputBox('What link content to be replaced with?', 'What link content to be replaced with?')
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
参考:http://hi.baidu.com/mysekai/blog/item/3c0ceb03863907e009fa93fb.html