Link to home
Start Free TrialLog in
Avatar of Arnie Pavlik
Arnie PavlikFlag for United States of America

asked on

Edit multiple hyperlinks in Excel 2013

I need to change many hyperlinks on an excel spreadsheet to point to a new location. I want to keep the filename the same, just change the network path. I've tried a few different scripts with no success.

This doesn't work:

Sub FixHyperlinks()
    Dim wks As Worksheet
    Dim hl As Hyperlink
    Dim sOld As String
    Dim sNew As String

    Set wks = ActiveSheet
    sOld = "\\servera\2014\DC1\CDP\Archive_Target\Denise's Files\Residential Work Orders\"
    sNew = "\\NEWSERVER\SharedData\Location\Residential Maintenance\Denise's Files\Residential Work Orders\"
    For Each hl In wks.Hyperlinks
        hl.Address = Replace(hl.Address, sOld, sNew)
    Next hl
End Sub

Please advise.
ASKER CERTIFIED SOLUTION
Avatar of rspahitz
rspahitz
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial