Re: application.match and multidimensional array?
- From: "KR" <nospam@xxxxxxxxxx>
- Date: Mon, 13 Mar 2006 12:20:11 -0500
I'm using several arrays in code (memory); the smaller array keeps a subset
of values that I'm tracking, and with each iteration of my code, it checks
that subset against the larger set to grab additional values. The larger
array is approximately (1 to 10, 1 to 5000) and the smaller array can be
anywhere from (1 to 10, 1 to 100) up to (1 to 10, 1 to 5000) where the
latter would end up including every element from the source array.
In my case, I'm going through up to 10 iterations where in each case I'm
checking for a cascade of values in the source array (thus my iterations);
for example, lets assume that it is a list of 5000 people who all know at
least some of the other people on the list. I might decide that I want to
know who I listed as my friends, in which case I'll only check to see who I
had listed as friends. Or I might want to know 1 degree of separation, in
which case I'll iterate through my own friends to generate a new source
list, then using that, I'll check for every unique value of any name that me
and my immediate friends have listed as friends...and so on...
I can iterate through my source array just fine, what I'm trying to do is
determine if each name that is found is unique to my sublist array so that I
can add it (and related information) if needed.
My alternative is to keep a single-dimension array just for the match
criteria, and add each new record to both that and my multidimensional
sublist at the same time. My concern about using the sheets is just speed
more than anything else- but perhaps I should go test it to see if it really
slows down the code that much...
Thanks!
Keith
"Bernie Deitrick" <deitbe @ consumer dot org> wrote in message
news:%23LGYs1rRGHA.4952@xxxxxxxxxxxxxxxxxxxxxxx
Keith,in code?
Are you using data in cells as your array, or are you working on an array
to a temp range if you are
In either case, you could use the Find method on a range (paste the range
using an array).news:eVLbuerRGHA.2300@xxxxxxxxxxxxxxxxxxxxxxx
HTH,
Bernie
MS Excel MVP
"KR" <nospam@xxxxxxxxxx> wrote in message
multidimensionalI need to find out if certain values are in one part of a
arraysarray. In the past I've used application.match against 1-dimensional
theto see if it throws an error (which tells me it isn't in the array).
Unfortunately I can't find any help for match or application.match in
isVBE help. Using XL2003 on Win2000.
Can I do the same thing with a multidimensional array, and if so, what
havethe proper way to identify the array in the match? e.g. should I just
matchesthe array name
(MySource())
or do I need to specify the part of the array to search
(MySource(1,))
Or do I have to copy the part of the array where I want to check for
thisto a new 1-D array? That would be inefficient, since I'll be looping and
adding hundreds (maybe thousands) of entries...but I have to find the
matches (or lack thereof), so I'm open to options.
I'd prefer not to deal with collections if there is a way to keep all
thein my array.
Thanks!
Keith
--
The enclosed questions or comments are entirely mine and don't represent
mythoughts, views, or policy of my employer. Any errors or omissions are
own.
.
- References:
- Prev by Date: Re: Change cell catagories?
- Next by Date: Re: Edit code - exclude sheets
- Previous by thread: application.match and multidimensional array?
- Next by thread: Macro to delete worksheets
- Index(es):