Hi,
I'm using a macro to replace hyperlinks in bulk.
e.g. the current hyperlinks are: T:\\servername\directory1\directory123\123workbook.xlsl
I need to replace the hyperlink with a web address, so I need to get rid of "T:\\servername" and keep the remainder as the links are sequential. I'm using following macro (found on this forum), which almost works perfectly:
This works but it trims the first 3 characters from "directory123", I know this is down to the "Len(olddr) + 1" from above code but not sure how to fix. can anyone help?![]()
Sub ChangeHyperlinks() Dim h As Hyperlink Dim oldDr As String, newDr As String oldDr = "T:\\servername" newDr = "http:\\webaddress\" For Each h In Sheets("Sheet1").Hyperlinks h.Address = newDr & Mid(h.Address, Len(oldDr) + 1, Len(h.Address)) Next h End Sub
Bookmarks