Forum Discussion
Changing multiple links to other worksheets - Help
- Oct 25, 2021
Hope I got it right 🙂
You want to change the link path on multiple hyperlinks ... if so then you could do it with VBA.
Sub ReplaceallHyperlink() Dim oldPath As String Dim newPath As String Dim myLink As Hyperlink ' Attention: Pay attention to upper / lower case, is important for the replacement oldPath = "C:\Users\nikolino\Downloads\Orga\" newPath = "C:\Users\nikolino\OneDrive\niko\Orga\Description\Quotation\" ' run through all hyperlinks in the sheet, sheet name must be adapted For Each myLink In Sheets("NikolinoDE").Hyperlinks ' and swap the old part for the new part in the address of the link myLink.Address = Replace(myLink.Address, oldPath, newPath) Next End Sub
Hope I was able to help you with this info.
I would be happy to know if I could help.
NikolinoDE
I know I don't know anything (Socrates)
Was the answer useful? Mark them as helpful!
This will help all forum participants.
Hope I got it right 🙂
You want to change the link path on multiple hyperlinks ... if so then you could do it with VBA.
Sub ReplaceallHyperlink()
Dim oldPath As String
Dim newPath As String
Dim myLink As Hyperlink
' Attention: Pay attention to upper / lower case, is important for the replacement
oldPath = "C:\Users\nikolino\Downloads\Orga\"
newPath = "C:\Users\nikolino\OneDrive\niko\Orga\Description\Quotation\"
' run through all hyperlinks in the sheet, sheet name must be adapted
For Each myLink In Sheets("NikolinoDE").Hyperlinks
' and swap the old part for the new part in the address of the link
myLink.Address = Replace(myLink.Address, oldPath, newPath)
Next
End Sub
Hope I was able to help you with this info.
I would be happy to know if I could help.
NikolinoDE
I know I don't know anything (Socrates)
Was the answer useful? Mark them as helpful!
This will help all forum participants.
NikolinoDE Thank you!
I will try it later
So far I have done it with find and replace changing the path. However your way looks much more clean.
I will revert.
Thank you again.