Excel userform control tip text

Apple08

Active Member
Joined
Nov 1, 2014
Messages
450
Hi everyone

I am new to Excel userform. Please is it possible to add comment to a label? If user hovers on the label and the comment will be appeared? Should I use control tip text? Is it possible to add bullets to the userform comments?

Any suggestions and help are appreciated.
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
Yes, ControlTiptext will do it. You can specify it in Form design, or at run time
Code:
Userform1.Label1.ControlTipText = "Yah boo! - this works!"
You can't have bullets, or text on different lines even - at least not on XL2010.
Code:
Userform1.Label1.ControlTipText = "Yah boo!" & vbCrLf & "- this works!"
gives the same effect as the code above.
 
Last edited:
Upvote 0
Many thanks! I wonder is it possible if I can add comments to multiple labels, create buttons of hide and unhide, then users can press unhide button to select whether they would like to see those comments and select hide to make comments invisible.

If this is possible, could you show me an example of code? I have over 20 label fields, so I hope there is an easy way to do them. Many thanks! Your help is much appreciated!
 
Upvote 0
Yes, it's very simple.

Create 2 new buttons and call them 'Show comments' and 'Hide comments'

Double click on each, it will create a new sub for each. they will look something like

Code:
Private Sub Button1_Click()

End Sub

where Button1 is the name of the button you clicked. You can change the name of the button in the Properties but if you do you need to change the name of the button in the code above to (whatever the new name is)_Click

Then in the sub code set the control tips to the text you want. For the show comments button you set the text to the words you want, for the Hide comments buttton set the text to blank e.g.

Code:
Private Sub Button1_Click()  'Show comments
    Userform1.Label1.ControlTipText = "Comment 1"
    Userform1.Label2.ControlTipText = "Comment 2"
    Userform1.Label3.ControlTipText = "Comment 3"
... and so on
End Sub
Private Sub Button2_Click()  'Hide comments
    Userform1.Label1.ControlTipText = ""
    Userform1.Label2.ControlTipText = ""
    Userform1.Label3.ControlTipText = ""
... and so on
End Sub
 
Last edited:
Upvote 0

Forum statistics

Threads
1,213,531
Messages
6,114,172
Members
448,554
Latest member
Gleisner2

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