Hyperlink Location Batch Change

Hi All.

I have a MS Excel 2007 document.  It has moved onto a different machine and I want to change part of the hyperlink location path on a few hundred cells.  For example, current path is


I want to batch change this to:

..\..\..\QA\Dropbox\Sample Analysis\

I know I need to run a macro but anything i have tried has not changed any hyperlinks or returned an error message

Any help would be greatly appreciated.

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.


pls try
Sub macro()

    For Each sh In Worksheets
       For Each lnk In sh.Hyperlinks
            lnk.Address = Replace(lnk.Address, _
",  _
            "\QA\Dropbox\Sample Analysis\")
        Next lnk
End Sub

Open in new window


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
[ fanpages ]IT Services ConsultantCommented:

I asked a similar query within another question thread earlier today...

Does the in-built "Search & Replace" [CTRL]+[H] function not allow you to change the hyperlinks?

Find what: ..\..\..\Users\HP-user\AppData\Users\HP-user\AppData\Roaming\Microsoft\Excel\
Replace with: ..\..\..\QA\Dropbox\Sample Analysis\

Within: Sheet
Search: By Rows
Look in: Formulas

Have you already tried this?


PCREPAIRIRLAuthor Commented:
Thanks Rgonzo1971: Top class
PCREPAIRIRLAuthor Commented:
Thanks to both of you guys.  :)
I tried both ways, but
- the first method "sub macro()" just does nothing - doesn't it work in EXCEL 2013?
- the second method does not find+replace hyperlinks, which are not formulas

So, what should I do?

- DonHannes
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.