View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
bill bill is offline
external usenet poster
 
Posts: 25
Default weird listbox behavior

yea I saw similar behavior. Actually, depending upon how I reorder things I
can get any one or two of the three listboxes to have "". I have tried
various delays between writing to the ListIndex, but it had no effect.


"JLGWhiz" wrote in message
...
Hold on, I did get it to repeat the anomaly and it is listbox 2 that is
returning the null string. However, it is showing as selected. I looks
like
it might be speed related but can't be positive.

"Bill" wrote:

All,

I have done a fair amount of Excel VBA programming, but this is a new odd
behavior. I have a form with 3 listboxes. All 3 listboxes have a range as
a
Rowsource. When the form opens they are all populated and display just
fine.
I want an item selected in the first listbox to force the same selection
(i.e. listindex) in the other 2 listboxes. In the listbox1_Click()
subroutine I put the following code:

listbox2.ListIndex = listbox1.ListIndex
listbox3.ListIndex = listbox1.ListIndex

v1 = listbox1.Value (or .Text)
v2 = listbox2.Value (or .Text)
v3 = listbox3.Value (or .Text)

v1 and v2 have the right stuff but v3 = ""

Any ideas?

TIA,

Bill