Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ToolTips in VBA?

Status
Not open for further replies.

bearnone

Programmer
Jan 7, 2003
10
US
I'm working on a VBA enabled spreadsheet and was hoping to use ToolTips to offer users help... can anyone offer away to use ToolTips (bubble help info that appears under a button after your mouse rests over it) with VBA.
 
Use the ControlTipText in the properties of the control.
 
The controltiptext property works nicely on form controls, but is not available for OLEObjects on the worksheet. In that case, you can program a workaround using worksheet events, something like:

Private Sub CommandButton1_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
ActiveSheet.Shapes("ToolTip").Visible = True
End Sub

Private Sub surround_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
ActiveSheet.Shapes("ToolTip").Visible = False
End Sub

Here, surround is a rectangle (an image control, in this particular case) with background color and line color set to "window background" that encloses the button control. The ToolTip object is a TextBox shape created using the drawing toolbar, formatted however you like.
Rob
[flowerface]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top