When you post code that someone else provided to you, you should at least acknowledge the source!
Have to use a ListBox???? oListOrComboBox as object should make it pretty clear that you can use a List or ComboBox!!!
Regardless, writing the value selected in a listbox to a textbox has little to do with how that listbox was populated.
Code:
Private Sub UserForm_Initialize()
With ListBox1
.AddItem "A"
.AddItem "B"
.AddItem "C"
End With
With ListBox2
.AddItem
.List(.ListCount - 1, 0) = "A"
.List(.ListCount - 1, 1) = "Apples"
.AddItem
.List(.ListCount - 1, 0) = "B"
.List(.ListCount - 1, 1) = "Birds"
.AddItem
.List(.ListCount - 1, 0) = "C"
.List(.ListCount - 1, 1) = "Cats"
End With
End Sub
Private Sub CommandButton1_Click()
TextBox1 = vbNullString
TextBox2 = vbNullString
If ListBox1.ListIndex <> -1 Then TextBox1 = ListBox1
If ListBox2.ListIndex <> -1 Then TextBox2 = ListBox2 'Uses the bound column
'Or use an explicit indexed column
'If ListBox2.ListIndex <> -1 Then TextBox2 = ListBox2.Column(0)
'If ListBox2.ListIndex <> -1 Then TextBox2 = ListBox2.Column(1)
lbl_Exit:
Exit Sub
End Sub