How can I increase the capacity of a listbox?

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.
 
J

JLGWhiz

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.
 
H

Hathor

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 **************************************************************
 
G

Gary Keramidas

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

For i = 1 To 50000
Me!ListBox1.AddItem Str(i) + " "
Next
 
J

JLGWhiz

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.
 

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