Science5 mins ago
Hyperlink File Paths
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
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
Answers
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
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
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
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.