This is Very werid, it's as if VBA in Excel 2003 has a bug....
If I do:
I get an error stating that it cannot get the selected property. When debugging I see that i is the same as Listbox1.ListCount, therefore, it is trying to get the selected value of an element that does not exist. So, I am having to put it as follows:VB Code:
For i = 0 To ListBox1.ListCount - 1 If ListBox1.Selected(i) Then ListBox2.AddItem ListBox1.List(i) End If Next
Any ideas or thoughts about this?VB Code:
For i = 0 To (ListBox1.ListCount - 1) If i = ListBox1.ListCount Then Exit For If ListBox1.Selected(i) Then ListBox2.AddItem ListBox1.List(i) End If Next




Reply With Quote