How can I increase the capacity of a listbox?

  • Thread starter Thread starter Hathor
  • Start date Start date
H

Hathor

My program is a complex Excel program. I have two forms of identical output.
I use file io to create a printable output file. That works OK. I also
want to put the same output (about 1000 lines of text) into a listbox.
However the listbox seems to have a maximum capacity of only 300 lines.
(More accurately the maximum capacity seems to be the number of characters in
the box, rather than the number of lines). Is there any way I can increase
the capacity of a listbox? I guess my backup plan is to use 2-3 listboxes
with the first part in the first box, and so one, but that is rather hokey.
 
I just put a listbox on a userform and set the rowsource for 1001 rows
without any problem. I didn't try arrays or additem, but I would suspect
they will allow more than 300 items in a single column listbox.
 
Here is the baby program that I wrote that simulates my real program:

For i = 1 To 1000
Me!List1.AddItem Str(i) + "
**************************************************************"
Next i

Here is the last line shown in the list box:

415 **************************************************************
 
just did this and it worked fine. how much ram do you have?

For i = 1 To 50000
Me!ListBox1.AddItem Str(i) + " "
Next
 
It would be limited by memory, but as Gary demonstrated, if you have the
storage capacity, it a listbox can handle a pretty good sized load.
 
Back
Top