Columns in list boxes

P

parkin_m

Hi I have a list box inside a form that I show to the user when a macro is
run. I would like to have columns inside the list box to make it look nicer -
I have tried to use the help included with word for this, but didnt get very
far!

Could anyone help?

I have an array of stuff that I am displaying inside the listbox

..addItem array(0) + " " + array(1)

How would i get array(0) and array(1) to be inside two different columns?
 
R

Rob

It depends on what you're trying to accomplish. You could do something like
this in the UserForm_Initialize to populate columns in a listbox:

Dim Array0(2, 4) As String

ListBox1.ColumnCount = 2

Array0(0, 0) = "0"
Array0(0, 1) = "1"
Array0(0, 2) = "2"
Array0(0, 3) = "3"

Array0(1, 0) = "3"
Array0(1, 1) = "2"
Array0(1, 2) = "1"
Array0(1, 3) = "0"

ListBox1.Column() = Array0

If you want to be able to select the items separately then this will be
useless. In that case you should jsut use two adjacent listboxes.
 

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