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,118,141
Messages
5,570,412
Members
412,323
Latest member
DemonX
Top