View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Ron Coderre Ron Coderre is offline
external usenet poster
 
Posts: 2,118
Default Need to Sort Multilevel Data List

How is the data list structured?

Like this?
Level_1 Level_2 Level_3
Div_1 (blank) (blank)
(blank) Dept_1 (blank)
(blank) (blank) Emp_1
(blank) Dept_2 (blank)
(blank) (blank) Emp_2
(blank) (blank) Emp_3
(blank) (blank) Emp_4
Div_2 (blank) (blank)
(blank) Dept_1 (blank)
(blank) (blank) Emp_1
(blank) Dept_2 (blank)
(blank) (blank) Emp_2
(blank) (blank) Emp_3
(blank) (blank) Emp_4

Or maybe this?
Level_1 Level_2 Level_3
Div_1 Dept_1 Emp_1
(blank) Dept_2 Emp_2
(blank) (blank) Emp_3
(blank) (blank) Emp_4
Div_2 Dept_1 Emp_1
(blank) Dept_2 Emp_2
(blank) (blank) Emp_3
(blank) (blank) Emp_4

or is it something else?
***********
Regards,
Ron

XL2002, WinXP


"NickH" wrote:

Sorry this is a bit of a ramble - I just hope it makes sense...

I have a problem which I'm hoping someone can help me think outside
the box with.

A data list of 17 columns and about 6000 rows is arranged in three
levels on a sheet. Data in a level 1 row will start in column B,
directly beneath each level1 row there may be one or more level 2
rows, pertaining to the same product, whose data will start in column
C and beneath each of these there may be one or more level 3 rows -
data beginning in column D.

I need to sort this data by, for instance, 'Status' - each row,
whatever level, will be at some status of Planning, Accepted, Rejected
etc. However, it is crucial that each row remains within its
respective level under the associated product (level 1).

My first thought was to copy all the level 1 rows to a separate sheet
and sort them there. Then copy the level 2 rows out to a separate
sheet, sort them and insert them back into the sorted level 1 rows and
then the same for level 3.

Level1 - fine, did that works a treat, all rows (about 2000) copied
and sorted within a second.
Level2 - not even halfway through after 5 mins
Level3 - didn't bother trying

For the interface to be acceptable this needs to happen within a
couple of seconds.

So, thinking outside the box, I figured why not have the routine, that
creates the data list in the first place, put some extra 'level
sorting' type info into some hidden columns on the right of the data
list. Such that I could then use the built-in sort engine by sorting
on 'Status' and then sorting on one or more hidden columns to restore
the level groups without losing the Status sort within those groups.

And that's where I'm stuck. I'm sure this is the right way to go but
cannot for the life of me work out what should go in these extra
columns or how many I would need.

Any bright sparks out there?

NickH