Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Populate multi-column list in worksheet not in a UserForm

I have simple list box on the sheet of an Excel (not on a userForm).
I want to add two column of information. I set the multi-column value to 2.
How can I add values to 2nd column?

Adding values to first column works fine such as:
lstTest.list = array("a","b","c")

but, adding value to second column doesn't work:
lstTest.list(0,1) = array("a","b","c")

And, I noticed that RowSource property is not there either, any one know why?

Thanks,
Afzal
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default Populate multi-column list in worksheet not in a UserForm

Dim myArr(1 To 3, 1 To 2)

myArr(1, 1) = "a1"
myArr(1, 2) = "a2"
myArr(2, 1) = "b1"
myArr(2, 2) = "b2"
myArr(3, 1) = "c1"
myArr(3, 2) = "c2"

lstTest.List = myArr

HTH,
Bernie
MS Excel MVP


"Afzal" wrote in message
...
I have simple list box on the sheet of an Excel (not on a userForm).
I want to add two column of information. I set the multi-column value to 2.
How can I add values to 2nd column?

Adding values to first column works fine such as:
lstTest.list = array("a","b","c")

but, adding value to second column doesn't work:
lstTest.list(0,1) = array("a","b","c")

And, I noticed that RowSource property is not there either, any one know why?

Thanks,
Afzal



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Populate multi-column list in worksheet not in a UserForm

Thanks Deitrick.
I found out why the other columns weren't showing.
I had placed 1 pt, 1 pt in ColumnWidths property assuming inches or cm to be
the default unit of measurement but it turns out 72 pt;72 pt is equivalent to
an inch.

"Bernie Deitrick" wrote:

Dim myArr(1 To 3, 1 To 2)

myArr(1, 1) = "a1"
myArr(1, 2) = "a2"
myArr(2, 1) = "b1"
myArr(2, 2) = "b2"
myArr(3, 1) = "c1"
myArr(3, 2) = "c2"

lstTest.List = myArr

HTH,
Bernie
MS Excel MVP


"Afzal" wrote in message
...
I have simple list box on the sheet of an Excel (not on a userForm).
I want to add two column of information. I set the multi-column value to 2.
How can I add values to 2nd column?

Adding values to first column works fine such as:
lstTest.list = array("a","b","c")

but, adding value to second column doesn't work:
lstTest.list(0,1) = array("a","b","c")

And, I noticed that RowSource property is not there either, any one know why?

Thanks,
Afzal




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 find a value with multi-column, multi-record list Dallasm Excel Worksheet Functions 1 May 30th 10 05:40 PM
Populate list box with multi-dimensional array Graham Whitehead Excel Programming 5 August 10th 06 12:23 PM
Multi Column UserForm ListBox Mik Excel Programming 1 May 4th 06 10:10 PM
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
Extract values from a multi-select multi-column list-box Peter[_20_] Excel Programming 5 September 28th 03 04:04 PM


All times are GMT +1. The time now is 10:55 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"