Hi,
I have been asked to help a team that have a spreadsheet that “keeps on breaking”, I have figure out that they have hyperlinks linking to word documents, but at the end of the year these folders are all moved into a YEARS folder – resulting in all the hyperlinks breaking!
This is going back to 2010, so will need to do this for 2010 - 2015
I have searched online and found a few solutions, but I cannot get any of them to work for me, I have tried:
Sub FixHyperlinks()
Dim OldStr As String, NewStr As String
OldStr = "\\fs4\lations\OFFICE\Press Statements\"
NewStr = "\\fs4\lations\ OFFICE\Press Statements\Responses 2010\"
Dim hyp As hyperlink
For Each hyp In ActiveSheet.Hyperlinks
hyp.Address = Replace(expression:=hyp.Address, _
Find:=OldStr, _
Replace:=NewStr, _
compare:=vbTextCompare)
Next hyp
End Sub
Sub Fix192Hyperlinks()
Dim OldStr As String, NewStr As String
OldStr = "\\fs4\lations\OFFICE\Press Statements\"
NewStr = "\\fs4\lations\ OFFICE\Press Statements\Responses 2010\"
Dim hyp As hyperlink
For Each hyp In ActiveSheet.Hyperlinks
hyp.Address = Replace(hyp.Address, OldStr, NewStr)
Next hyp
End Sub
Any ideas what I am doing wrong?
I have been asked to help a team that have a spreadsheet that “keeps on breaking”, I have figure out that they have hyperlinks linking to word documents, but at the end of the year these folders are all moved into a YEARS folder – resulting in all the hyperlinks breaking!
This is going back to 2010, so will need to do this for 2010 - 2015
I have searched online and found a few solutions, but I cannot get any of them to work for me, I have tried:
Sub FixHyperlinks()
Dim OldStr As String, NewStr As String
OldStr = "\\fs4\lations\OFFICE\Press Statements\"
NewStr = "\\fs4\lations\ OFFICE\Press Statements\Responses 2010\"
Dim hyp As hyperlink
For Each hyp In ActiveSheet.Hyperlinks
hyp.Address = Replace(expression:=hyp.Address, _
Find:=OldStr, _
Replace:=NewStr, _
compare:=vbTextCompare)
Next hyp
End Sub
Sub Fix192Hyperlinks()
Dim OldStr As String, NewStr As String
OldStr = "\\fs4\lations\OFFICE\Press Statements\"
NewStr = "\\fs4\lations\ OFFICE\Press Statements\Responses 2010\"
Dim hyp As hyperlink
For Each hyp In ActiveSheet.Hyperlinks
hyp.Address = Replace(hyp.Address, OldStr, NewStr)
Next hyp
End Sub
Any ideas what I am doing wrong?