The result I want is for the path to be removed so that
the hyperlink "Address" is
2007%2010%2022%20V&M%200.jpg
-- the hyperlink address without file path.
Sub RemoveAddr()
Dim x As Integer, r As Range
On Error Resume Next
For Each r In Selection
x = InStrRev(r.Hyperlinks(1).Address, "\")
If x > 0 Then
r.Hyperlinks(1).Address = Right(r.Hyperlinks(1).Address, _
Len(r.Hyperlinks(1).Address) - x)
End If
Next r
End Sub
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.