Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 43
Default Multi-column two-dimensional quick sort

Hi -

I've gone through many of the old posts on quick sorting and haven't
quite come across what I think would solve my problem.

I have a very large array that has been loaded from multiple
worksheets.
In general, its somewhere in the neighborhood of 100,000 rows x 10
columns.

What I'd like to do is sort all the information based first on the
values in each of the rows and one of the columns and then within that
set, sorting on a second column, and so on until the entire array has
been sorted by each of the columns.

What I've seen will sort on any one column within a 2-d array, but not
multiple columns.

Thanks in advance
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,588
Default Multi-column two-dimensional quick sort

You could try loading the data into an ADO recordset and using the
recordset's sort method.

could expand/modify this (see second example):
http://groups.google.com/groups?hl=e...%40cppssbbsa05


Tim.


"Marston" wrote in message
om...
Hi -

I've gone through many of the old posts on quick sorting and haven't
quite come across what I think would solve my problem.

I have a very large array that has been loaded from multiple
worksheets.
In general, its somewhere in the neighborhood of 100,000 rows x 10
columns.

What I'd like to do is sort all the information based first on the
values in each of the rows and one of the columns and then within

that
set, sorting on a second column, and so on until the entire array

has
been sorted by each of the columns.

What I've seen will sort on any one column within a 2-d array, but

not
multiple columns.

Thanks in advance



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 593
Default Multi-column two-dimensional quick sort

"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 worksheet 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.

--
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Multi Dimensional Lookup coolkat Excel Discussion (Misc queries) 1 June 14th 11 11:48 PM
Multi-dimensional VLOOKUP / PivotTable ? carlyman Excel Discussion (Misc queries) 6 June 14th 05 12:35 AM
Viewing Multi dimensional array Codea Excel Programming 1 August 5th 04 01:30 PM
Enumerating a multi-dimensional array Robert Stober Excel Programming 7 September 13th 03 12:28 PM
sort multi-dimensional array on numeric data? RB Smissaert Excel Programming 0 July 14th 03 10:49 PM


All times are GMT +1. The time now is 08:22 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"