Yuda Pratama
Yuda Pratama

Reputation: 31

How to show tooltip on mouseover in shape excel

I have a problem. I already make a maps with shape on excel. I want show information when i direct cursor to one of location. Thanks before

Upvotes: 0

Views: 14459

Answers (2)

Noam Brand
Noam Brand

Reputation: 346

One limitation of the above answer is that the shape will show the screen tip on hover but a macro assigned to the shape will not work by click. A workaround suggested by Tim Williams:

VBA Run Macro and Screen Tip (or Tool Tip) From Shape. I cannot get the code I found to work

Upvotes: 3

Gary's Student
Gary's Student

Reputation: 96791

We can use the property of a Hyperlink that can display a ToolTip on MouseOver.

I have a Shape called MyShape. Running this macro:

Sub MeaningOfLife()
    Dim r As Range
    Set r = Selection

    ActiveSheet.Shapes.Range(Array("MyShape")).Select
    ActiveSheet.Hyperlinks.Add _
        Anchor:=Selection.ShapeRange.Item(1), _
        Address:="", _
        ScreenTip:="The Meaning of Life Is..."

    r.Select
End Sub

will assign an inactive hyperlink to the Shape.

  • hovering displays the ToolTip
  • clicking does nothing

enter image description here

Upvotes: 10

Related Questions