
Columns in List box, when inserting text from text box (VBA)
Hi Ibby
I've had problems loading an array into a listbox with 11 or 12 columns.
Word 97/Win98. When testing the code below - it works and the columns are
all visible. . Before posting this I also tested the code on a combobox and
it works.
Somehow I have a feeling there must be some circumstances under which the
problem occurs.
'Works just fine when testing
'Column count set in the userform
Dim aBig(24, 15) As String
Dim i As Long
Dim j As Long
For i = 0 To 24
For j = 0 To 15
aBig(i, j) = "Any - " & j
Next
Next
ListBox1.List = aBig
--
/Anna Bohman
Bra Utbildning AB, Sweden
http://www.buab.se
-------------------------------------------------------------------------
Quote:
> Hi Carlos, Cindy,
> I don't think it's a problem with a limit on the number of columns in
> ListBox - the following loads data into 20,000 columns - stopped testing
> after that. Carlos: can you show us the code you're using to load the
> ListBox.
> --------------------------------------------
> Dim myArray(19999, 0) As String
> Dim i As Long
> For i = 0 To 19999
> myArray(i, 0) = CStr(i)
> Next i
> ListBox1.ColumnCount = 20000
> ListBox1.Column = myArray
> --------------------------------------------
> Hope this helps.
> ibby
> Please post replies or follow-ups to the **newsgroup** so that
participants
> may benefit or contribute.
> > Hi Carlos,
> > > It
> > > will work all day long up to 10 columns just not over
> > > that. I have looked to see if there is a list box column
> > > limit and to see if there is a character limit for a list
> > > box that will hold me back. I can find nothing that would
> > > lead me to that conclusion.
> > Except the behavior you're seeing... I'd guess that 10
> > columsn is the limit.
> > Cindy Meister
> > INTER-Solutions, Switzerland
> > http://homepage.swissonline.ch/cindymeister
> > http://www.mvps.org/word
> > http://go.compuserve.com/MSOfficeForum
> > This reply is posted in the Newsgroup; please post any follow
> > question or reply in the newsgroup and not by e-mail :-)