View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
witek witek is offline
external usenet poster
 
Posts: 147
Default Use a listbox as a dynamic array?

Robert Crandal wrote:
My VBA program will require multiple dynamic arrays of
strings. These will be "parallel arrays", meaning the arrays
will be the same size, and the indexes of each array will
be related to the corresponding indexes of the other arrays.

So....I decided that I do NOT want to bother using dynamic
arrays for my program, simply because dynamic arrays are
a pain to manage, and other reasons related to the design of
my program.

Instead, I was thinking about creating a few hidden Listbox
controls on a Userform (i.e Visible = False). Then, I could
simply use Listbox.AddItem() to continually add new strings
to the various hidden Listbox's, and possibly remove or
search for strings if necessary.

I'm just curious, but has anybody ever implemented something
like this in their VBA program? How did it work for you?
Were there any problems that I should know about?

What does everybody else think about this idea?

I'd appreciate any comments. Thank you.

Robert


I did.
it works well, however I can't tell anything about performance because
it was used for very small arrays.

By the way that is the only way to get empty two-dimensional array. (no
elements)