Solved

populate 3 listboxs  from 1 listbox column

Posted on 2014-02-28
7
210 Views
Last Modified: 2014-03-06
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
0
Comment
Question by:fordraiders
  • 4
  • 3
7 Comments
 
LVL 48

Accepted Solution

by:
Rgonzo1971 earned 500 total points
ID: 39896939
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
0
 
LVL 3

Author Comment

by:fordraiders
ID: 39899722
type mismatch error

Array1 = Application.Index(ListBox4.List, , 23)
0
 
LVL 3

Author Comment

by:fordraiders
ID: 39899748
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
0
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 
LVL 48

Expert Comment

by:Rgonzo1971
ID: 39899763
How are

Array1,  Array2 & Array3 defined?

Are they defined like this?
Dim array1 As Variant
0
 
LVL 3

Author Comment

by:fordraiders
ID: 39899775
yes...
0
 
LVL 48

Expert Comment

by:Rgonzo1971
ID: 39899799
Could you send a dummy example

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

Regards
0
 
LVL 3

Author Closing Comment

by:fordraiders
ID: 39909331
Thanks got it to work
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Dealing with unintended Excel Active-X resizing quirks (VBA code simulates "self correction") David Miller (dlmille) Intro Not everyone is a fan of Active-X controls in spreadsheets (as opposed to the UserForm approach, the older Form controls …
Convert between Excel file formats (.XLS, .XLSX, .XLSM) with/without macro option David Miller (dlmille) Intro Over this past Fall, I've had the opportunity to see several similar requests and have developed a couple related solutions associate…
The viewer will learn how to simulate a series of sales calls dependent on a single skill level and learn how to simulate a series of sales calls dependent on two skill levels. Simulating Independent Sales Calls: Enter .75 into cell C2 – “skill leve…
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now