CheckBox Comments on Userform - Mouse Hover Over

Chubski

New Member
Joined
Apr 25, 2011
Messages
11
Hello,

Can anyone advise if it is possible to show a relatively small message (say 50 to 70 characters) if a user hovers over a checkbox on a userform?

I know I could simply go with the MsgBox option if checkbox is selected but at this way the user would receive the info before selecting thereby saving a couple of clicks. Given the userform may have a few such messages it would be worthwhile finding a solution this way.

Kind regards

C
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
You could use a label, with code like this

Code:
Private Sub UserForm_Initialize()
    With Label1
        .Caption = "my message"
        .Visible = False
    End With
End Sub

Private Sub CheckBox1_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal x As Single, ByVal y As Single)
    With Label1
        .Top = CheckBox1.Top + CheckBox1.Height / 2
        .Left = CheckBox1.Left + CheckBox1.Width - 5
        .Visible = True
    End With
End Sub

Private Sub UserForm_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal x As Single, ByVal y As Single)
    Label1.Visible = False
End Sub
 
Upvote 0
Thanks Mike,

That is a great idea.

I've tweaked it slightly to have a small area of the userform which I have boxed off and have the label appear there with the relevant message.

One question though is whilst I can get the label to appear it does not disappear when I move the mouse away from the specified checkbox. I've used the exact code that you supplied.

BTW - for some reason I can't get Initialize to work so I amended the code and dropped it into a module and have it called just prior to it SHOWing the userform. As I say it still works though.

Any idea?

Regards

C
 
Upvote 0
Mike,

Sorry for me being a dufus !!

I see that it does disappear when I move the mouse back over the same checkbox. Doh !

Appreciate the assist with this and it will help me a lot.

Kind regards

C
 
Upvote 0

Forum statistics

Threads
1,224,600
Messages
6,179,834
Members
452,947
Latest member
Gerry_F

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