• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Excel Userform ComboBox/TextBox match

JPNess

New Member
Hi, this question may have been asked and answered.
I have a ComboBox on a userform which displays data off an excel spreadsheet, column C and there's corresponding data in column D.
When I make a selection in the ComboBox which is displaying data from column C, I'm looking to display the corresponding data from column D in a TextBox.
So far I've only been able to get the ComboBox and TextBox to match i.e. what I select in the ComBox shows up also in the TextBox.

Any advice?
 

Attachments

  • UserForm.JPG
    UserForm.JPG
    17.3 KB · Views: 5
Hi Belleke, thanks for the advice but it errors out - 'Could not get Column property. Invalid argument'.
Both of the columns (C and D) I mentioned are on a separate spreadsheet to where the userform initiates.
 
This is what I've done so far;

>>> use code - tags <<<
Code:
Private Sub UserForm_Initialize()
Me.ComboBox1.RowSource = "TFO_SORs!ItemName"
End Sub

Private Sub ComboBox1_Change()
TextBox1.Value = ComboBox1.Value
End Sub
 
Last edited by a moderator:
It is possible but it is a bit tricky.
Have a look in the module to see the code.
Hoover over the Combobox and scroll.
 

Attachments

  • TFO - SOR (belle v2).xlsm
    66.5 KB · Views: 12
Back
Top