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

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.

al_b_cnu

Well-known Member
Joined
Jul 18, 2003
Messages
4,526
Hi, Welcome to the board!

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

Roccafelie

Board Regular
Joined
Jun 30, 2008
Messages
129
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

al_b_cnu

Well-known Member
Joined
Jul 18, 2003
Messages
4,526
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,190,764
Messages
5,982,789
Members
439,797
Latest member
ebeck462

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
Top