Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 114
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 783
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to populate a multi-column activeX listbox on a spreadsheet with an ADO recordset quartz Excel Programming 1 May 3rd 04 10:13 PM
Multi-column ListBox. Multiple bound columns??? Joe Mathis Excel Programming 5 December 10th 03 01:32 AM
populate listbox JSnader Excel Programming 2 December 6th 03 02:43 PM
Populate listBox Hamster Excel Programming 1 September 17th 03 01:14 PM
ListBox Populate Rod Taylor Excel Programming 3 July 22nd 03 12:11 AM


All times are GMT +1. The time now is 02:44 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"