Display dynamicly comments in textbox Userform

VeKa27

New Member
Joined
Sep 11, 2015
Messages
45
Hi all,

Need some help on this one. I am trying to make a userform with this functionality:

If th euserform opens you see 3 textboxes to be filled in and one textbox that is ment to display comments.
So the Userform has 3 textboxes to fill in. What i want is that if the user selects textbox1, there is a comment displayed in textbox4.
When the user selects textbox2, the comment in textbox4 changes to the comment of textbox2. (each textbox 1 to 3 has his own comment to be displayed)
When the user selects textbox3, the comment in textbox4 changes to the comment of textbox3
Textbox4 chould not be selectable by the user, this one is just to display the comments of the other 3 textboxes.

I tried several codes with .SetFocus and .Activate but it did not work.

Can someone put me on the right way?

Thanks a lot!
 

Some videos you may like

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
L

Legacy 456155

Guest
Hi there. Add a userform with TextBox1, 2, and 3. Add Label1. Paste in this code.

VBA Code:
Private Sub UserForm_Initialize()
    TextBox1.ControlTipText = "This is message 1"
    TextBox2.ControlTipText = "This is message 2"
    TextBox3.ControlTipText = "This is message 3"
End Sub

Private Sub TextBox1_Enter()
    UpdateMessage
End Sub

Private Sub TextBox2_Enter()
    UpdateMessage
End Sub

Private Sub TextBox3_Enter()
    UpdateMessage
End Sub

Private Sub UpdateMessage()
    Label1 = ActiveControl.ControlTipText
End Sub

If you don't want the tooltip showing, use the Tag property instead.
 

VeKa27

New Member
Joined
Sep 11, 2015
Messages
45
Hi Dataluver,

I followed your code and it works like a charm! Exactly what i needed.
Fortunately there are people like you.. ;)

Heartfelt Thanks for your input..
 

Watch MrExcel Video

Forum statistics

Threads
1,123,426
Messages
5,601,585
Members
414,460
Latest member
uctc

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