Good luck with this one

  • Thread starter Thread starter ScpttCybak
  • Start date Start date
S

ScpttCybak

Guest
Hi all, i've been hacking away at this for a few hours now, and i've come to the conclusion that it's beyond my knowledge.

I want to select multiple rows in a listbox via vba..

i realize you can select a single row by using the .ItemData(RowIndex), but if run in a loop where the RowIndex increases, it over-rides the previous and only highlights the current one.

The .ItemData will only take a single integer, so arrays are out of the question, and strings cause crashes. Comma seperated lists of numbers also cause crashes as does pretty much everything else i've tried. It only takes a single number. I tried to throw multiple instance of = .ItemData a number of ways, to no avail.

Thanks in advanced!
 
Try

Me.List0.Selected(1) = True
Me.List0.Selected(2) = True

which will highlight rows two and three
-remembering the listbox is zero based.

Ian
 
Also, make sure you have the Multiple Selection property set to either Simple or Extended.

Doug

[This message has been edited by D-Fresh (edited 08-27-2001).]
 

Users who are viewing this thread

Back
Top Bottom