Extracting unique array entries to listbox 
Author Message
 Extracting unique array entries to listbox

I have a large table in Word XP with a large number of columns from which I
would like place unique combinations of two of the columns into a listbox,
so that I can then select a row and create summary statistics.  Getting all
the items into an array -oldArray-is not a problem.Where I get into trouble
is searching  oldArray and placing the unique combinations into either a
second array-newArray- or directly into the listbox. I can populate a
listbox from an array, no problem, it's creating newArray.
I will not know the dim of newArray in advance, so I will
need help to redim and or redim preserve as well.
My table looks like this
-oldArray-
a    x
a    y
b    y
b    y
a    x
c    z
b    z
c    z
a    y
The new array should look like this
-newArray-
a    x
a    y
b    y
c    z
b    z
Any help to code this will greatly appreciated.


Fri, 16 Sep 2005 02:19:25 GMT  
 Extracting unique array entries to listbox
Hi John,

See the article Deleting duplicate rows in a table at:

http://www.mvps.org/word/FAQs/MacrosVBA/DeleteDupRows.htm

Please respond to the newsgroups for the benefit of others who may be
interested.

Hope this helps
Doug Robbins - Word MVP

Quote:
> I have a large table in Word XP with a large number of columns from which
I
> would like place unique combinations of two of the columns into a listbox,
> so that I can then select a row and create summary statistics.  Getting
all
> the items into an array -oldArray-is not a problem.Where I get into
trouble
> is searching  oldArray and placing the unique combinations into either a
> second array-newArray- or directly into the listbox. I can populate a
> listbox from an array, no problem, it's creating newArray.
> I will not know the dim of newArray in advance, so I will
> need help to redim and or redim preserve as well.
> My table looks like this
> -oldArray-
> a    x
> a    y
> b    y
> b    y
> a    x
> c    z
> b    z
> c    z
> a    y
> The new array should look like this
> -newArray-
> a    x
> a    y
> b    y
> c    z
> b    z
> Any help to code this will greatly appreciated.



Fri, 16 Sep 2005 06:03:08 GMT  
 Extracting unique array entries to listbox
Thanks Doug- I'll have to give this some thought and test it out.
Will let you know how I do.



Quote:
> Hi John,

> See the article "Deleting duplicate rows in a table" at:

> http://www.mvps.org/word/FAQs/MacrosVBA/DeleteDupRows.htm

> Please respond to the newsgroups for the benefit of others who may be
> interested.

> Hope this helps
> Doug Robbins - Word MVP


> > I have a large table in Word XP with a large number of columns from
which
> I
> > would like place unique combinations of two of the columns into a
listbox,
> > so that I can then select a row and create summary statistics.  Getting
> all
> > the items into an array -oldArray-is not a problem.Where I get into
> trouble
> > is searching  oldArray and placing the unique combinations into either a
> > second array-newArray- or directly into the listbox. I can populate a
> > listbox from an array, no problem, it's creating newArray.
> > I will not know the dim of newArray in advance, so I will
> > need help to redim and or redim preserve as well.
> > My table looks like this
> > -oldArray-
> > a    x
> > a    y
> > b    y
> > b    y
> > a    x
> > c    z
> > b    z
> > c    z
> > a    y
> > The new array should look like this
> > -newArray-
> > a    x
> > a    y
> > b    y
> > c    z
> > b    z
> > Any help to code this will greatly appreciated.



Fri, 16 Sep 2005 10:56:43 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. How to extract ContactItem entry id from the AddressEntry entry id

2. Please help me put selected entries from array into listbox

3. Extracting data from unknown locations in unique files of unknown size

4. Unique entry IDs

5. Making all the entries in a record set unique

6. Unique Data Entry.

7. ensuring unique items in combobox/listbox

8. Get Unique Values from an Array

9. Creating Unique Random Integers in an Array

10. Creating an array of unique random numbers

11. Generating an array of 50 unique integers

12. Selecting unique elements of an array...

 

 
Powered by phpBB® Forum Software