Learning about arrays?

M

M. Authement

Can anyone recommend a book, website, etc. that provides good, thorough
information on arrays and using them in VBA? I just spent a few days
painfully bludgeoning my way through some code where I learned that I can't
ReDim Preserve the first dimension of a two dimension array, that I had to
declare certain arrays as variant in order to get them to work (with
Transpose, I think), etc. I'd prefer to learn these lessons through other
means ;-)

I did some Google searches but all I could find were tutorials on what an
array is, how to declare them, ReDim/Preserve basics, etc. I am looking for
something more in depth.
 
M

M. Authement

Tom,

Thanks for the info. I wasn't expecting an entire book on arrays, though
with all the books out there you just never know.

I don't know that it was the Transpose that caused the issue (and from your
example I suspect it is not). The problem was that I didn't know what I
didn't know. I am using GetPrivateProfile to return some ini keys and
values, removed the NULL values, split the 1D array of key=value into a 2D
array of keys and values, transposed that array, and put it in a range (all
through passing array to multiple function/sub calls). I put it all
together using code I found from Google/Newsgroups with limited
understanding of what I was doing (I tried, but this is the first time I
have dealt with arrays in any real way). I tried so many things and all I
know is that the code would compile but not run unless some of the arrays
were declared as variants (and the only two error messages I got, over and
over and over, were subscript out of range and type mismatch). I probably
declared one array as variant in a function and things propagated from
there. I'd post it but its a lot of code from several modules...I'll go
back and look at some things and try to narrow down the problem area first.

I downloaded Alan Beban's Array Functions and will work through the code and
will continue to ask questions here as needed. This place is better than
any book but learning is a bit disorganized this way, at least for me.
Sorry for the long post and sob story...at least I feel better now ;-)
 

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