Listbox question please

  • Thread starter Thread starter kirkm
  • Start date Start date
K

kirkm

What should the command ...

Me.List1.ListIndex = t

.... actually do ?

Should it set line t as the selected line in the list box, and also be
highlit ... or not ?

Thanks - Kirk
 
On Sun, 18 Mar 2007 23:46:33 +1200, kirkm

A little bit later I substituted

List1.Selected(t) = True

This seemed to work better and I first
thought you don't set List1.listIndex= anything.

List1.Selected(t) by itself is all that required.

However, this also fails about 1 time in 12.

For an experiment I added

List1.Selected(t) = True
Do
Loop Until List1.Selected(t) = True
MsgBox List1.Selected(t)


Every time row t was highlit, the msgbox output was True.

But also, when it *wasn't* highlit, it also said True.

Does this make sense to anyone?

Thanks - Kirk
 
There is a pretty comprehensive explanation for the selected property in VBA
help. There are also example code snippets.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top