ANSWER
I tried the Chr(9) function to create a tab, but the result is a tab in the same column.
I'm using Microsoft Forms 2.0 Listbox, so I think this is the standard. I'm using VBA in Excel, but I don't use any features of Excel (worksheets, ...)
There's no TextMatrix property.
There is a way to fill the Listbox correctly with a matrix:
Dim MyArray(6,2)
Private Sub UserForm_Initialize()
Dim i As Single
ListBox1.ColumnCount = 3
For i = 0 To 5
MyArray(i, 0) = i
Next i
MyArray(0, 1) = "Zero"
MyArray(1, 1) = "One"
MyArray(2, 1) = "Two"
MyArray(3, 1) = "Three"
MyArray(4, 1) = "Four"
MyArray(5, 1) = "Five"
MyArray(0, 2) = "Zero"
MyArray(1, 2) = "Un ou Une"
MyArray(2, 2) = "Deux"
MyArray(3, 2) = "Trois"
MyArray(4, 2) = "Quatre"
MyArray(5, 2) = "Cinq"
ListBox1.List() = MyArray
End Sub
BUT I DONT'T WANTED THIS.
JEZES!! I JUST FOUND THE SOLUTION!!!!!!!!
Instead of:
Midilist.ListBox1.List(0, 0) = "Row 1, Col 1"
Midilist.ListBox1.List(0, 1) = "Row 1, Col 2"
Midilist.ListBox1.List(1, 0) = "Row 2, Col 2"
Midilist.ListBox1.List(1, 1) = "Row 2, Col 2"
It has to be:
Midilist.ListBox1.AddItem "Row 1, Col 1"
Midilist.ListBox1.List(0, 1) = "Row 1, Col 2"
Midilist.ListBox1.AddItem "Row 2, Col 1"
Midilist.ListBox1.List(1, 1) = "Row 2, Col 2"
It seams that every time AddItem is used, it changes the column where other commands can put their values.
THIS QUESTION CAN BE CLOSED NOW
DO I HAVE TO DO THAT??? HOW???
Thanks for the help!
Best Regards
Ruben
Main Topics
Browse All Topics





by: rspahitzPosted on 2002-09-04 at 15:04:01ID: 7262807
Two things come to mind:
1) Use a tab character to separate items between column one and column two and you may get the second column filled.
2) The listbox has, I think, a TextMatrix property that lets you specify a row and column where you want data to go.
--
So
1) Are you using VB or VBA? If VBA, then what application is hosting it: Word, Excel, Access, etc?
2) There are several listbox control available. Are you using the standard "ListBox"? (Look in the property window of VB for the dropdownlist; the name is on the left half of the box and the object type is on the right half.)