Print

Print


The listindex of an unselected listbox is 0.  Try this

Sub Button2_Click()
dim lb as listbox
for each lb in ActiveSheet.ListBoxes
     MsgBox lb.ListIndex
next
End Sub

end sub




"Tim and Amy Ford" <[log in to unmask]>
28/07/99 04:04


Please respond to [log in to unmask]

To:   "Excel Discussion Group" <[log in to unmask]>
cc:    (bcc: Matthew Inns/CFS/ThamesWater)
Subject:  Index Value for a Non-Selected List Box




I have a number of list boxes that I need to collect the index values from
for various calculations.  What I need to know is what index value is
assigned to a list box if none of the items in the list box are selected?
I
need to know when a specific list box is overlooked/not used.






%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%