Populate multi-column list in worksheet not in a UserForm

A

Afzal

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
 
B

Bernie Deitrick

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
 
A

Afzal

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top