Thanks, I found that:
To populate a two column listbox:
With UserForm.LB1
.ColumnCount = 2
.ColumnWidths = "6;6"
.AddItem "1"
.List(0, 0) = "Name1"
.List(0, 1) = "E-mail1"
.AddItem "2"
.List(1, 0) = "Name2"
.List(1, 1) = "E-mail2"
.ListIndex = 1 ' Sets the default value
End With
To retrieve: First Column: UserForm.LB1.Column(0, .LB1.ListIndex) Second column: UserForm.LB1.Column(1, .LB1.ListIndex)
To populate a single column listbox:
With UserForm.LB1
.AddItem "Name1"
.AddItem "Name2"
.ListIndex = 1
End with
To retrieve: UserForm.LB1.List(.LB1.ListIndex)
__________________
Backup your original file before doing any modification.
|