Change hyperlink throughout excel


B

Bryan S

I found this link in the (Discussion Groups – Excel), Replace hyperlink
throughout excel - Posted 5/2/2006. And was hoping to use it to fix some of
the hyperlinks I’ve created that will be changing. It referred me to
http://www.mvps.org/dmcritchie/excel/buildtoc.htm#FixHyperlinks
Fix Hyperlinks
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
This is an example of what I’m hoping to do:
(change) hyperlink
\\Gbserver\Jobs\8900 to 8999\8934 Ridgewater College
(to) hyperlink
\\Gbserver\Jobs\8000’s\8900 to 8999\8934 Ridgewater College

Where a folder is being added to the string but the end location will have
names that vary. It doesn’t seem to be possible to use * (wild character) to
put in place of a different end location for each hyperlink. Any ideas? Help
is greatly appreciated. I'm using MS Excel 2007.
 
Ad

Advertisements

D

Dave Peterson

I'm not sure a single example is enough to show what you really need to do.

But maybe...

OldStr = "\\Gbserver\Jobs\8900"
NewStr = "\\Gbserver\Jobs\8000's\8900"

would be enough
 

Ask a Question

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.

Ask a Question

Top