Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RichPollock/c91953671d1be506e817aa75cc905853 to your computer and use it in GitHub Desktop.
Save RichPollock/c91953671d1be506e817aa75cc905853 to your computer and use it in GitHub Desktop.
Update all hyperlinked shapes to reflect a new sheet name
Sub ChangeHyperlinkedShapesToUseNewSheetNames()
Dim ws As Worksheet
For Each ws In ActiveWorkbook.Worksheets
For Each shp In ws.Shapes
If shp.Type = 1 Then
On Error Resume Next
If shp.Hyperlink.SubAddress = "'Old sheet'!A1" Then
shp.Hyperlink.SubAddress = "'New sheet'!A1"
End If
End If
Next shp
Next ws
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment