Listbox, getting not selected items.

  • Thread starter Thread starter Lars Pedersen
  • Start date Start date
L

Lars Pedersen

How to you referer to items in a listbox that are not selected using vba, it
does not seem to have a property for items that are not selected.


/Lars
 
Lars Pedersen presented the following explanation :
How to you referer to items in a listbox that are not selected using vba, it
does not seem to have a property for items that are not selected.


/Lars

Hi,

It has a property for selected, which can be used, I think

dim lngCount as long
for lngCount = 0 to me!lstMyList.listcount-1
if Me!lstMyList.Selected(lngCount) then
debug.print Me!lstMyList.column(1, lngCout) & " is selected"
else
debug.print Me!lstMyList.column(1, lngCout) & " is not
selected"
end if
next lngCount
 
Don't forget that the row and column numbers are relative to zero --- the
first column is zero and the first row is zero. Also ... if you show
headers this adds 1 to the row number (the header row is now zero and the
first data row is # 1). Maybe this is what's happening....

Lars Pedersen said:
I testet it, but I only get the column name.

/Lars
 
Thanks everybody, I think I need to read some more about listboxes before I
start using them.

/Lars

Bob Howard said:
Don't forget that the row and column numbers are relative to zero --- the
first column is zero and the first row is zero. Also ... if you show
headers this adds 1 to the row number (the header row is now zero and the
first data row is # 1). Maybe this is what's happening....
 
Back
Top