So you used the insert|hyperlink version of hyperlinks, right?
This is from David McRitchie's site:
Sub Fix192Hyperlinks()
Dim OldStr As String, NewStr As String
OldStr = "http://192.168.15.5/"
NewStr = "http://hank.home.on.ca/"
Dim hyp As Hyperlink
For Each hyp In ActiveSheet.Hyperlinks
hyp.Address = Replace(hyp.Address, OldStr, NewStr)
Next hyp
End Sub
Try something like:
Option Explicit
Sub Fix192Hyperlinks()
Dim OldStr As String, NewStr As String
OldStr = "E:\Cards\All Cards-For Linking\"
NewStr = "C:\Cards\SpecialBatch\ALL CARDS-FOR LINKING\"
Dim hyp As Hyperlink
For Each hyp In ActiveSheet.Hyperlinks
hyp.Address = Replace(expression:=hyp.Address, _
Find:=OldStr, _
Replace:=NewStr, _
compa=vbTextCompare)
Next hyp
End Sub
I added the keywords in the replace line and the compare parm.
If you're not familiar with VBA, take a look at those sites in the earlier post.
Terry wrote:
On Wed, 12 Aug 2009 17:35:47 GMT, (Terry)
wrote:
=On Tue, 11 Aug 2009 14:08:05 -0500, Dave Peterson
wrote:
=
==I like to use the =hyperlink() worksheet function for this.
=
=Wow! Thanks, Dave, this looks like the mother lode of linking
=information....
Dave:--
My ignorance of Excel and VB is obvious! I tried everything in your
post and nothing worked. Gloom...
Here's the present situation:
Excel 2003 Sheet with filenames in A6:A619, each referring to file by
that name.
Hyperlink now for a file is:
file:\\\E:\Cards\All Cards-For Linking\filename.jpg
New desired link is:
file:\\\C:\Cards\SpecialBatch\ALL CARDS-FOR LINKING\filename.jpg
If I manually change one for the other, all is well, but there must be
an easier way. Find/replace works OK when the link info is displayed
as text, but not if just the filename is displayed.
If you have the time, could you take pity on me and show me what to
do?
TIA--
Terry--WB4FXD
Edenton, NC
--
Dave Peterson