How do I change the state of an item in a (form) multiselect list box
Hi Brian,
Try usuing the ListBox's ListIndex property, the first item
is item 0, the second is item 1.
For example, to select the fourth item, try something like:
'=============
Private Sub UserForm_Initialize()
With Me.ListBox1
.ColumnCount = 4
.List = Range("A1:D20").Value
.ListIndex = 3
End With
End Sub
'<<=============
---
Regards,
Norman
wrote in message
ups.com...
I have a multiselect list box in a form that I need to use to
manipulate some other data. I have already defeated the problem of
getting useful data out of the list box. The problem is that when the
form with the list box is loaded, it populates the list box from
scratch. How can I make the code select a specific entry?
Listname.List(i).Select does not work.
I can properly identify every list item that is being added and know
its position in the list (as well as a reference cell that indicates
if it should be selected). I just can't figure out how to select the
appropriate items.
Help would be greatly appreciated! Thanks!
Brian
|