Button tips

F

Francis Hookham

Using Basic Shapes as buttons running macros, is it possible for a
descriptive 'tip' to be programmed in which will appear when the mouse
hovers over, as is the case with toolbar buttons?

Francis Hookham
 
G

Gary''s Student

Do not assign the macro directly to the Shape. Instead, assign a hyperlink
to the Shape to take you to a remote location within the worksheet, say Z100.
Then create a worksheet event macro to call the desired macro whenever z100
is Selected.

The advantage to using the hyperlink is that you can assign a tooltip to the
hyperlink that will appear by mouse_over. Here is an example:

Say the macro you want to run is named dural. In worksheet code enter:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Set t = Target
Set r = Range("Z100")
If Intersect(t, r) Is Nothing Then Exit Sub
Call dural
End Sub
 
J

JLGWhiz

Look up ControlTipsText in VBA help file. Here is some sample code from the
help file.

Private Sub UserForm_Initialize()
MultiPage1.Page1.ControlTipText = "Here in page 1"
MultiPage1.Page2.ControlTipText = "Now in page 2"

CommandButton1.ControlTipText = "And now here's"
CommandButton2.ControlTipText = "a tip from"
CommandButton3.ControlTipText = "your controls!"
End Sub
 
F

Francis Hookham

Thank you JLGWhiz and Gary''s Student for your wonderful prompt reply.

I'll try both

I am most grateful

Francis
 

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