Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Populate 2-column ListBox with 2 non-contiguous columns
Hi guys
I would like to populate a 2-column ListBox with 2 non-contiguous columns. I know how to do this by looping through the two column arrays, but am wondering if there's a way of assigning each column array to the ListBox.Column [or other] property (without looping). Thanks in advance Paul Martin Melbourne, Australia |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Populate 2-column ListBox with 2 non-contiguous columns
Paul,
I thought the "Union" method would be the solution. But it wouldn't work for me. The following works, if you have an adjacent empty column... '----------------------------- Sub PutThemTogetherInListBox() Dim rngCombine As Excel.Range 'Transfer values from 2nd column next to the 1st column 'B10:B100 holds the first column of data. Range("C10:C100").Value = Range("F10:F100").Value 'Get the new range and load listbox1 Set rngCombine = Range("B10:C100") UserForm1.ListBox1.List = rngCombine.Value 'Return column to original? state Range("C10:C100").ClearContents UserForm1.ListBox1.ListIndex = 0 UserForm1.Show Set rngCombine = Nothing End Sub '------------------------------------ Regards, Jim Cone San Francisco, USA "Paul Martin" wrote in message om... Hi guys I would like to populate a 2-column ListBox with 2 non-contiguous columns. I know how to do this by looping through the two column arrays, but am wondering if there's a way of assigning each column array to the ListBox.Column [or other] property (without looping). Thanks in advance Paul Martin Melbourne, Australia |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Populate 2-column ListBox with 2 non-contiguous columns
Paul Martin wrote:
Hi guys I would like to populate a 2-column ListBox with 2 non-contiguous columns. I know how to do this by looping through the two column arrays, but am wondering if there's a way of assigning each column array to the ListBox.Column [or other] property (without looping). Thanks in advance Paul Martin Melbourne, Australia Why do you want to do it without looping? Alan Beban |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to populate a multi-column activeX listbox on a spreadsheet with an ADO recordset | Excel Programming | |||
Multi-column ListBox. Multiple bound columns??? | Excel Programming | |||
populate listbox | Excel Programming | |||
Populate listBox | Excel Programming | |||
ListBox Populate | Excel Programming |