Dependent Text Box In User Form

Closed
Report
Posts
17
Registration date
Thursday March 3, 2011
Status
Member
Last seen
July 20, 2011
-
Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
August 2, 2020
-
Hello,
Let say I have a table below and I would like to make my user form second text box to automatically display the result base on my input at the first text box,how can I achieve that?It is is easy to do that by normal combo box data validation in excel worksheet,but how does one apply data validation in user form input boxes?

Number Name
1 John
2 Kim

When I input "1" at my first text box and hit Enter/Tab key,my second text box will automatically display "John".When I input "2" at my first text box than "Kim" will be display in my second text box.Can somebody supply me with the necessary code and guide me please....I'm still a beginner with VBA codes.

Thanks

1 reply

Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
August 2, 2020
768
use onchange event to do that