Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
How Can I Globally Change Hyperlinks?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  10 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Terry  
View profile  
 More options Aug 12, 4:05 am
Newsgroups: microsoft.public.excel.links
From: katamaso...@hotmail.com (Terry)
Date: Tue, 11 Aug 2009 18:05:35 GMT
Local: Wed, Aug 12 2009 4:05 am
Subject: How Can I Globally Change Hyperlinks?

I seem to know just enough about Excel to be dangerous, and therein
lies my question.

I have a spreadsheet (1 sheet) that has some 600 (and climbing) rows,
one column of each having a hyperlink to a file on an external drive.
Eventually, all the linked files will be moved to another disk and the
links changed to that new drive's location.

Is there a way to globally change the links to the other disk when the
project is completed. I have stopped adding links until I discover a
way, for I really don't want to do the changes manually one at a time!

Thanks for any advice.

Cheers--Terry
Terry--WB4FXD
Edenton, NC


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Terry  
View profile  
 More options Aug 12, 4:23 am
Newsgroups: microsoft.public.excel.links
From: katamaso...@hotmail.com (Terry)
Date: Tue, 11 Aug 2009 18:23:18 GMT
Local: Wed, Aug 12 2009 4:23 am
Subject: Re: How Can I Globally Change Hyperlinks?

My bad! It's Excel 2003 I'm using. Sribouthat!

Cheers--
Terry--WB4FXD
Edenton, NC


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Dave Peterson  
View profile  
 More options Aug 12, 5:08 am
Newsgroups: microsoft.public.excel.links
From: Dave Peterson <peter...@verizonXSPAM.net>
Date: Tue, 11 Aug 2009 14:08:05 -0500
Local: Wed, Aug 12 2009 5:08 am
Subject: Re: How Can I Globally Change Hyperlinks?
I like to use the =hyperlink() worksheet function for this.

I'll put the path in a hidden cell (A1 in my example).  (Include the trailing
backslash, too!)

Then put the filenames in A2:Axxx
Then use the =hyperlink() formula in B2:Bxx.

=hyperlink("File:////"&$a$1&a2,"Click me")
and drag down

Then when I need to change the folder, I can change it one location (A1).

I could embed the path directly in the formula:
=hyperlink("File:////c:\my documents\excel\"& a2,"Click me")
and use Edit|Replace, but that seems like more work to me.

========
If you used Insert|Hyperlink, then you've noticed that edit|replace won't touch
those hyperlink addresses.

Saved from a previous post:

If you used Insert|hyperlink (xl2003 menus), you'll have more work to do.  But
the good news is David McRitchie has done most of it for you:

http://www.mvps.org/dmcritchie/excel/buildtoc.htm
look for:
Fix Hyperlinks       (#FixHyperlinks)

If you're new to macros:

Debra Dalgleish has some notes how to implement macros here:
http://www.contextures.com/xlvba01.html

David McRitchie has an intro to macros:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

Ron de Bruin's intro to macros:
http://www.rondebruin.nl/code.htm

(General, Regular and Standard modules all describe the same thing.)

--

Dave Peterson


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Terry  
View profile  
 More options Aug 13, 3:35 am
Newsgroups: microsoft.public.excel.links
From: katamaso...@hotmail.com (Terry)
Date: Wed, 12 Aug 2009 17:35:47 GMT
Local: Thurs, Aug 13 2009 3:35 am
Subject: Re: How Can I Globally Change Hyperlinks?
On Tue, 11 Aug 2009 14:08:05 -0500, Dave Peterson

<peter...@verizonXSPAM.net> wrote:

=>I like to use the =hyperlink() worksheet function for this.

Wow! Thanks, Dave, this looks like the mother lode of linking
information. I've printed your post and will start looking at sources.

Company at the house now and I dast not desert them for fear of
incurring the wrath of She Who Must be Obeyed...!!

Many thanks again.

Cheers--
Terry--WB4FXD
Edenton, NC


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Terry  
View profile  
 More options Aug 14, 2:11 am
Newsgroups: microsoft.public.excel.links
From: katamaso...@hotmail.com (Terry)
Date: Thu, 13 Aug 2009 16:11:00 GMT
Subject: Re: How Can I Globally Change Hyperlinks?
On Wed, 12 Aug 2009 17:35:47 GMT, katamaso...@hotmail.com (Terry)
wrote:

=>On Tue, 11 Aug 2009 14:08:05 -0500, Dave Peterson

=><peter...@verizonXSPAM.net> 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


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Dave Peterson  
View profile  
 More options Aug 14, 3:00 am
Newsgroups: microsoft.public.excel.links
From: Dave Peterson <peter...@verizonXSPAM.net>
Date: Thu, 13 Aug 2009 12:00:09 -0500
Local: Fri, Aug 14 2009 3:00 am
Subject: Re: How Can I Globally Change Hyperlinks?
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, _
                        compare:=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.

--

Dave Peterson


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Terry  
View profile  
 More options Aug 14, 7:15 am
Newsgroups: microsoft.public.excel.links
From: katamaso...@hotmail.com (Terry)
Date: Thu, 13 Aug 2009 21:15:55 GMT
Local: Fri, Aug 14 2009 7:15 am
Subject: Re: How Can I Globally Change Hyperlinks?
On Thu, 13 Aug 2009 12:00:09 -0500, Dave Peterson

<peter...@verizonXSPAM.net> wrote:

=>So you used the insert|hyperlink version of hyperlinks, right?

Yes

=>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

I tried this--no joy

=>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, _
=>                        compare:=vbTextCompare)
=>    Next hyp
=>End Sub

And this, too. Still no joy.

I entered a file name, added a hyperlink through the Edit function,
and made sure the link was correct. I changed the link to the new link
and checked it, too. OK. Then changed the link back to the old link.

Next, I put the code in the VB edit window by right-clicking "Sheet
1", selecting "View Code", and typing in the code.

I returned to the sheet through "File"/"Close...and Return..."

Old link still there.

Back to the code. F5 to run. Some crunching somewhere I think...

Back to the sheet. No joy. Still the old adress.

Was this the way to do it?

Groan again + Help!

Be patient--I'm old!

Cheers--

Terry--WB4FXD
Edenton, NC


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Dave Peterson  
View profile  
 More options Aug 14, 7:41 am
Newsgroups: microsoft.public.excel.links
From: Dave Peterson <peter...@verizonXSPAM.net>
Date: Thu, 13 Aug 2009 16:41:57 -0500
Local: Fri, Aug 14 2009 7:41 am
Subject: Re: How Can I Globally Change Hyperlinks?
The code should be placed in a General module (not behind the worksheet).

Inside the VBE
Insert|Module

And move the code there.

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

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

Then hit alt-F8 and run the macro.

ps.  Make sure your slashes match what you used in the hyperlinks.  Hyperlinks
can be pretty forgiving, but string comparisons aren't!

--

Dave Peterson


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Terry  
View profile  
 More options Aug 15, 1:27 am
Newsgroups: microsoft.public.excel.links
From: katamaso...@hotmail.com (Terry)
Date: Fri, 14 Aug 2009 15:27:18 GMT
Local: Sat, Aug 15 2009 1:27 am
Subject: Re: How Can I Globally Change Hyperlinks?
On Thu, 13 Aug 2009 16:41:57 -0500, Dave Peterson

<peter...@verizonXSPAM.net> 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, _
            Compare:=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


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Dave Peterson  
View profile  
 More options Aug 19, 9:11 am
Newsgroups: microsoft.public.excel.links
From: Dave Peterson <peter...@verizonXSPAM.net>
Date: Tue, 18 Aug 2009 18:11:54 -0500
Local: Wed, Aug 19 2009 9:11 am
Subject: Re: How Can I Globally Change Hyperlinks?
How about copy|pasting a few of the old (untouched) links into your next
message.

Or run some tests against a copy of the worksheet.

Oldstr = "ALL"
newstr = "xxx"

just to see if that's working.

--

Dave Peterson


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google