Add the name to column 2 of the combobox. Retrieve it from the Change event of the combobox.
Private Sub CBList_Change()
'Look at column 2 of the combobox for the name stored with number.
TBName.Value = CBList.Column(1, Me.CBList.ListIndex)
End Sub
Private Sub UserForm_Initialize()
Dim LR As Integer, Counter As Integer, Entry As String
LR = Data.Cells(Rows.Count, 2).End(xlUp).Row
For Counter = 2 To LR
Entry = Data.Cells(Counter, 1).Value
CBList.AddItem Entry, Counter - 2
'Add the name to colum 2 of the combobox. It acts like an array.
CBList.Column(1, Me.CBList.ListCount - 1) = Data.Cells(Counter, 2).Value
Next Counter
End Sub
Bookmarks