UserForm (Adding Comments)

Roccafelie

Board Regular
Joined
Jun 30, 2008
Messages
129
Hello Everyone,

I have a short question...I have some text listed on my UserForm and I want to add "custom comments" explaning each text field when user scroll the mouse on the text field. Is that possible ?

Thank you in advance
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
Hi, Welcome to the board!

Try entering your comments in the 'ControlTipText' property of the required controls
 
Upvote 0
Thank you mate, you made my day!...One more question

I want those comments be printed when I command

UserForm.PrintForm

is that possible ?

Hi, Welcome to the board!

Try entering your comments in the 'ControlTipText' property of the required controls
 
Upvote 0
Hi,

Never used .PrintForm personally, but depending on what you require, you may possibly be able to copy the comment to a label (using the control's MouseMove event or click event), which would then be printable.

For example if your userform has 3 controls, TaxtBox1, CommandButton1 and Label1, the following code will place the ControlTipText into Label1:
Code:
Private Sub CommandButton1_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
If Label1.Caption <> CommandButton1.ControlTipText Then
    Label1.Caption = CommandButton1.ControlTipText
End If
End Sub

Private Sub TextBox1_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
If Label1.Caption <> TextBox1.ControlTipText Then
    Label1.Caption = TextBox1.ControlTipText
End If

End Sub
 
Upvote 0

Forum statistics

Threads
1,213,487
Messages
6,113,943
Members
448,534
Latest member
benefuexx

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