Donate SIGN UP

Hyperlink File Paths

Avatar Image
Barquentine | 16:39 Thu 26th Dec 2013 | Computers
3 Answers
I have inserted hyperlinks to mp3 tracks from a list of songs on an Excel spreadsheet - both the mp3 tracks and the spreadsheet are on a memory stick.
I copied all to the C-drive of a laptop - now none of the hyperlinks work because the file path says G:\ but the files are in a different drive now.
Is there a way to fix this?
thanks
Gravatar

Answers

1 to 3 of 3rss feed

Avatar Image
If you have a lot of cells to change, you can use a macro to automate it. Paste the following into a new macro, between the "Sub" and "End Sub" lines. Then just highlight all of the cells with hyperlinks in and run the macro. You can customise oldpath and newpath as required. Dim link As String Dim cell As Range Dim oldpath As String Dim newpath As String oldpath =...
17:49 Thu 26th Dec 2013
Right-click the cells with the hyperlinks, select Edit hyperlink, and change G:\ to C:\.
If you have a lot of cells to change, you can use a macro to automate it. Paste the following into a new macro, between the "Sub" and "End Sub" lines. Then just highlight all of the cells with hyperlinks in and run the macro. You can customise oldpath and newpath as required.

Dim link As String
Dim cell As Range
Dim oldpath As String
Dim newpath As String

oldpath = "G:\"
newpath = "C:\"

For Each cell In Selection

If (cell.Hyperlinks.Count) > 0 Then
link = cell.Hyperlinks.Item(1).Address
cell.Hyperlinks.Item(1).Address = Replace(link, oldpath, newpath)
End If

Next cell

Question Author
Thank you Aquariel -that works a treat!

1 to 3 of 3rss feed

Do you know the answer?

Hyperlink File Paths

Answer Question >>

Related Questions

Sorry, we can't find any related questions. Try using the search bar at the top of the page to search for some keywords, or choose a topic and submit your own question.