View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Additems from one listbox with multiple columns to another

What line causes the error?

I didn't notice this before, but I think you'll want to change this portion:

If .lst_bs_school.Selected(x) = True Then
.lst_bs_bm.AddItem .lst_bs_school.List(x, 0)
.lst_bs_bm.List(.lst_bs_bm.listcount-1, 2) = .lst_bs_school.List(x, 1)
.lst_bs_bm.List(.lst_bs_bm.listcount-1, 3) = .lst_bs_school.List(x, 2)
.lst_bs_bm.List(.lst_bs_bm.listcount-1, 4) = .lst_bs_school.List(x, 3)
.lst_bs_bm.List(.lst_bs_bm.listcount-1, 5) = .lst_bs_school.List(x, 4)
.lst_bs_bm.List(.lst_bs_bm.listcount-1, 6) = .lst_bs_school.List(x, 5)
'.lst_bs_school.Selected(x) = False
End If




BigPig wrote:

Hi David,

"Dave Peterson" wrote:

Maybe you assigned a .list in code or while you were designing the form.

I'd add one more line:

....
..lst_bs_bm.Clear
..lst_bs_bm.list = "" '<-- Added
....


I tried as you suggested. Checked over the rest of my code and the listbox
properties, but didn't see anything.
I received the same error as before but with: ..lst_bs_bm.list="". Took it
out and tried again, but still the same error on the same line:
.lst_bs_bm.List(x, 2) = .lst_bs_school.List(x, 1)

If I take out all the entries other than additem (.list..), it adds as it
should but only in the 1st column (out of 6).

Thank you, your advice is always appreciated.


--

Dave Peterson