Control Tip or MouseOver label on Excel shapes

D

Dale Fye

I'm using Access VBA to build an Excel Workbook which visually depicts a
bunch of project timelines.

I am creating lines which depict the duration of the project, along with
boxes and several other shapes which depict key events along the timelines.
I would like to add a control tip text or something like that for each of
these shapes, so that when a user hovers their mouse over the shape, it can
display additional information.

How would I do this using VBA?

Dale Fye
 
P

Peter T

Shapes do not support tooltips, however you could add a dummy hyperlink with
a tooltip, eg

' add say a rectangle to the sheet
Sub Test()
Dim shp As Shape

Set shp = ActiveSheet.Shapes(1)

ActiveSheet.Hyperlinks.Add shp, "", "", _
ScreenTip:="Hello from " & shp.Name

End Sub

As written, the Address and SubAddress arguments are empty, though you could
of course include a real link.

Regards,
Peter T
 
D

Dale Fye

Thanks, Peter.

Worked like a charm.

Dale

Peter T said:
Shapes do not support tooltips, however you could add a dummy hyperlink
with a tooltip, eg

' add say a rectangle to the sheet
Sub Test()
Dim shp As Shape

Set shp = ActiveSheet.Shapes(1)

ActiveSheet.Hyperlinks.Add shp, "", "", _
ScreenTip:="Hello from " & shp.Name

End Sub

As written, the Address and SubAddress arguments are empty, though you
could of course include a real link.

Regards,
Peter T
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top