View Single Post
  #9   Report Post  
Posted to microsoft.public.excel.links
Terry Terry is offline
external usenet poster
 
Posts: 12
Default How Can I Globally Change Hyperlinks?

On Thu, 13 Aug 2009 16:41:57 -0500, Dave Peterson
wrote:

=The code should be placed in a General module (not behind the
worksheet).
=
=Inside the VBE
=Insert|Module
=
=And move the code there.

This the code I am using:

Option Explicit
Sub CardHyperlinks()
Dim OldStr As String, NewStr As String
OldStr = "file:///E:\QSL CARDS\ALL CARDS-FOR LINKING\"
NewStr = "file:///C:\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

=Then double check to make sure you have the old link path correct in
the code (as well as the new link path).

They match the present and future locations.

=Then select the worksheet with the links (the code uses the
ActiveSheet).

Only one sheet in this project.

=Then hit alt-F8 and run the macro.

No Joy. : () ( Still the old (present) link.

I stepped through the code with F8 and no unusual action was seen.

=ps. Make sure your slashes match what you used in the hyperlinks.

Several times, but they are exactly what the link actually is, all
slashes especially!

I must be doing something wrong. But what?

Cheers--

Terry--WB4FXD
Edenton, NC