populate 3 listboxs from 1 listbox column

Fordraiders
Fordraiders used Ask the Experts™
on
excel 2010 vba

userform 4 listboxes

What I have:
I have 3 listboxes that I need populated from 1 Listbox

Listbox1
Listbox2
Listbox3

I need the listbox to contain data from Listbox4 : specifically.

Listbox1 = Listbox4.column(23)
Listbox2  = Listbox4.column(24)
Listbox3  = Listbox4.column(25)

Thanks
fordraiders
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2016
Commented:
Hi,

pls try

Array1 = Application.Index(ListBox4.List, , 23)
Array2 = Application.Index(ListBox4.List, , 24)
Array3 = Application.Index(ListBox4.List, , 25)
ListBox1.List = Array1
ListBox2.List = Array2
ListBox3.List = Array3

Open in new window

Or
ListBox1.List = Application.Index(ListBox4.List, , 23)
ListBox2.List = Application.Index(ListBox4.List, , 24)
ListBox3.List = Application.Index(ListBox4.List, , 25)

Open in new window

Regards

Author

Commented:
type mismatch error

Array1 = Application.Index(ListBox4.List, , 23)

Author

Commented:
This is working but taking a very long time.
if i have alot of items in the listbox4 ?


UserForm2.ListBox4.Clear
With UserForm2.ListBox4
    For ri = .ListCount - 1 To 0 Step -1
        UserForm2.ListBox1.AddItem .List(ri, 23)
    Next
End With
Amazon Web Services

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

Top Expert 2016

Commented:
How are

Array1,  Array2 & Array3 defined?

Are they defined like this?
Dim array1 As Variant

Author

Commented:
yes...
Top Expert 2016

Commented:
Could you send a dummy example

I cannot reproduce the error unless the LisBox.List array has no 23rd col

Regards

Author

Commented:
Thanks got it to work

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial