Text Hover over Image

GoKu

Board Regular
Joined
Dec 18, 2007
Messages
244
Hi All, I am using an image for an icon on my worksheet to which I have assisigned a Macro. Is it possible to have descriptive text displayed when the mouse id moved over the image?
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
Hello GoKu

Pictures don't have a MouseMove event, but labels do.

Create a new ActiveX label from the Control Toolbox, and place it over the picture (make it a good fit).

Next in properties change its' BackStyle to transparent.

We will assume the label is called Label1.

Attach the following code to it:
Rich (BB code):
Private Sub Label1_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
    Dim dblTop As Double
    Dim dblLeft As Double
 
    With Me.Label1
        dblTop = .Top + .Height
        dblLeft = .Left + .Width
    End With
 
    With Me.Shapes.AddCallout(msoCalloutOne, dblLeft, dblTop, 100, 30)
        .Visible = msoTrue
        With .TextFrame
            .Characters.Text = "Yo ho ho and a bottle of rum!"
            .HorizontalAlignment = xlHAlignCenter
            .VerticalAlignment = xlVAlignCenter
        End With
        Application.Wait Now + TimeSerial(0, 0, 1)
        .Delete
    End With
End Sub
 
Last edited by a moderator:
Upvote 0
Rather than asking again, as this is what I want to do, I thought I'd post here.

This is what I wish to do.
I've created a picture, which runs a macro when you click on the picture. But, when the mouse "hovers" but has not been clicked over the picture, I get a floating "pop up" text, to tell the user what the picture/button does before they click it.

The above answer, sounds exactly the answer, but despite making the label and using the code above, when I hover the mouse over the label, nothing seems to happen.
As I only "semi know what I'm doing here" Can anyone please suggest a basic error I may be making in getting this to work?

I know it's asking a lot, but I don't know what I'm doing wrong!

Thank you :)
 
Upvote 0
Add a link to the shape, select "place in this document", reference any cell and enter the text you wish to see when hovering in the screen tip section.
 

Attachments

  • 1.png
    1.png
    26 KB · Views: 129
Upvote 0

Forum statistics

Threads
1,223,577
Messages
6,173,162
Members
452,503
Latest member
AM74

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top