Option
Explicit
Private
Sub
ListBox1_DblClick(
ByVal
Cancel
As
MSForms.ReturnBoolean)
If
ListBox1.ListIndex < 0
Then
Exit
Sub
With
ListBox1
TextBox1.Text = .List(.ListIndex, 0)
TextBox2.Text = .List(.ListIndex, 1)
End
With
End
Sub
Private
Sub
UserForm_Initialize()
Call
InitListBox1
End
Sub
Public
Sub
InitListBox1()
With
ListBox1
.Clear
.ColumnCount = 2
Call
.AddItem(
"Name1"
)
.List(.ListCount - 1, 1) =
"Vorname1"
Call
.AddItem(
"Name2"
)
.List(.ListCount - 1, 1) =
"Vorname2"
Call
.AddItem(
"Name3"
)
.List(.ListCount - 1, 1) =
"Vorname3"
End
With
End
Sub