Hyperlinks update with filepath

mj_bowen

Board Regular
Joined
Oct 4, 2009
Messages
99
Hi,

I have several large excel files each with multiple hyperlinks contained within them.
For example,

One hyperlink has the address
hyperlink=F:work/planning/week1.doc

This link would work fine as long as the folder containing the file was located on the F: drive (an external drive).

My question ..I have recently uploaded this folder to a cloud server through googledrive (located at C:googledrive/work/planning/week1.doc. on the drive of my work PC and the my docs folder of my home PC.

My question is how to get the hyperlinks to work regardless of the location of the Google driver folder without having to alter the hundreds of hyperlinks in each file.

Kind regards, Matt
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.

tweedle

Well-known Member
Joined
Aug 1, 2010
Messages
1,559
I don't think you're going to be able route them without modifying the links (the physical storage for the file has changed, after all).
Something like this might help update the Address of the hyperlinks.

Code:
    Dim hl As Hyperlink
    For Each hl In ActiveSheet.Hyperlinks
        newaddress = Replace(hl.Address, "F:", "C:googledrive")
        Debug.Print "Original:"; hl.Address
        Debug.Print "Update  :"; newaddress
        'hl.Address = newaddress
    Next hl
 
Upvote 0

Forum statistics

Threads
1,196,028
Messages
6,012,956
Members
441,740
Latest member
abaz21

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top