Data from Combo Box

S

Sue

Hi all

I got the following code off this forum

Private Sub UserForm_Initialize()
Cb2.List = ActiveSheet. _
Range("A2:C200").Value
End Sub

ComboBox Cb2 displays the info when opened
e.g. Name | Sex | DOB

I have two textboxes on the Userform
Tb1 & Tb2
I need Tb1 & Tb2 to fill with the data from Cb2

Sex | DOB

Everytime I click on a different name - it they will change automatically
I can then add them to a new sheet Named "Correct" in Cols E & F respectively
been at it a couple of hours and I need you experts to guide me
 
R

Rick Rothstein

Add this event procedure to your UserForm's code window...

Private Sub Cb2_Click()
Tb1.Text = Cb2.Column(1)
Tb2.Text = Cb2.Column(2)
End Sub
 
S

Sue

Hi Rick

Isn't it easy when you know how??

Works a treat
--
Many Thanks

Sue


Rick Rothstein said:
Add this event procedure to your UserForm's code window...

Private Sub Cb2_Click()
Tb1.Text = Cb2.Column(1)
Tb2.Text = Cb2.Column(2)
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top