×
The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.
Solution found! One of our Excel gurus came up with a VB module, the code
for which appears below. The only change you'll need to make is to the
ChangeServerName() subroutine, which replaces an old string with a new
string. The instructions for actually using this module include a lot of
screen prints in a Word document, which won't travel well in the
midrange.com email group, so if anyone is interested in getting the Word
document, shoot me a private email, and I'll send it to you.
Public Sub ReplaceHyperlinkURL(FindString As String, ReplaceString As
String)
Dim LinkURL, PreStr, PostStr, NewURL As String
Dim FindPos, ReplaceLen, URLLen As Integer
Dim MyDoc As Worksheet
Dim MyCell As Range
Dim ws As Worksheet
On Error GoTo ErrHandler
For Each ws In ActiveWorkbook.Worksheets
'Set MyDoc = ActiveSheet
Set MyDoc = ws
For Each MyCell In MyDoc.UsedRange
If MyCell.Hyperlinks.Count > 0 Then
LinkURL = MyCell(1).Hyperlinks(1).Address
FindPos = InStr(1, LinkURL, FindString)
If FindPos > 0 Then 'If FindString is found
ReplaceLen = Len(FindString)
URLLen = Len(LinkURL)
PreStr = Mid(LinkURL, 1, FindPos - 1)
PostStr = Mid(LinkURL, FindPos + ReplaceLen, URLLen)
NewURL = PreStr & ReplaceString & PostStr
MyCell(1).Hyperlinks(1).Address = NewURL 'Change the URL
End If
End If
Next MyCell
Next ws
MsgBox ("Update Complete")
Exit Sub
ErrHandler:
MsgBox ("ReplaceHyperlinkURL error")
End Sub
Sub ChangeServerName()
Call ReplaceHyperlinkURL("\\OldServer\vol1\prodmgmt\common\Library\<file://oldserver/vol1/prodmgmt/common/Library/>",
"\\NewServer\VOL1\prodmgmt\common\Library\<file://newserver/VOL1/prodmgmt/common/Library/>
")
End Sub
As an Amazon Associate we earn from qualifying purchases.
This thread ...
Re: mass change of hyperlinks in Excel, (continued)
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact
[javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.