Display dynamicly comments in textbox Userform

VeKa27

Board Regular
Joined
Sep 11, 2015
Messages
56
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!
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
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.
 
Upvote 0
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..
 
Upvote 0

Forum statistics

Threads
1,214,667
Messages
6,120,818
Members
448,990
Latest member
rohitsomani

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