Re: Multi-column two-dimensional quick sort
From: Marston (marston_gould_at_mac.com)
Date: 08/11/04
- Next message: Nater: "Re: Picture the same size as a cell"
- Previous message: Reiner: "Runtime error 91"
- In reply to: Jamie Collins: "Re: Multi-column two-dimensional quick sort"
- Messages sorted by: [ date ] [ thread ]
Date: 11 Aug 2004 11:00:30 -0700
Actually - I thought of another way.
Since none of my column data are zero valuded (and never will be)
I've added another column of data to my dataset that effectivley is
the concatenation of the info I want to sort in the order I want it
sorted.
Then I can run a quick sort on that column and everything will be as I
want.
jamiecollins@xsmail.com (Jamie Collins) wrote in message news:<2ed66b75.0408110346.4870fb26@posting.google.com>...
> "Tim Williams" wrote ...
>
> > > I have a very large array that has been loaded from multiple
> > > worksheets.
> > > What I've seen will sort on any one column within a 2-d array, but
> > > not multiple columns.
>
> > You could try loading the data into an ADO recordset and using the
> > recordset's sort method.
>
> A good suggestion. However, rather than fabricating a recordset based
> on the array, the OP may be able to create the recordset already
> populated *and* sorted using the work*** data, all in one query e.g.
>
> SELECT
> MyCol1 AS Col1,
> MyCol2 AS Col2,
> MyCol3 AS Col3,
> MyCol3 AS Col4
> FROM
> [Sheet1$]
> UNION
> SELECT
> MyColA AS Col1,
> MyColB AS Col2,
> MyColC AS Col3,
> MyColD AS Col4
> FROM
> [Sheet2$]
> ORDER BY
> 1,2,3,4
> ;
>
> If you then need an array, use the recordset's GetRows method.
>
> Jamie.
>
> --
- Next message: Nater: "Re: Picture the same size as a cell"
- Previous message: Reiner: "Runtime error 91"
- In reply to: Jamie Collins: "Re: Multi-column two-dimensional quick sort"
- Messages sorted by: [ date ] [ thread ]