Skip to content

Instantly share code, notes, and snippets.

@RichPollock
Last active December 11, 2015 13:48
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/4609965 to your computer and use it in GitHub Desktop.
Save RichPollock/4609965 to your computer and use it in GitHub Desktop.
Set the tool tips of all hyperlinked shapes in Excel to the text contained in the shape (thereby replacing the default tool tip, which includes the document file path)
Sub AddScreenTipsToHyperlinkedShapesUsingShapeText()
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
shp.Hyperlink.ScreenTip = shp.OLEFormat.Object.ShapeRange.TextFrame.Characters.Text
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