#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 14
Default subtotals and sorts

Hi and thanks for the help. I am using Excel 2003. I have a spreadsheet with
about 200 rows and 5 columns of data. There are numerous rows that hold
subtotals.

I need to sort based on the subtotals--BUT keep all the rows together that
belong with that subtotal. Is that possible??


  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9,101
Default subtotals and sorts

I can be done with a custom macro. The macro would need find the continuous
rows associated with each subtotal. The swap the two groups. It would be a
bubble sort routine which swaps multiple rows of data. the general form of a
buble sort is

for i = 1 to (lastrow - 1)
For j = (i + 1) to lastrow

if (subtotal_blocki subtotal_blockj) then

temp_block = blocki
blocki = blockj
blockj =temp_block

end if
next j
next i

the block sizes may not be the same number of rows, do instead of swapping
some combination of .copy, .insert.entirerow, and .delete.entirerow would be
used.
"SheriTingle" wrote:

Hi and thanks for the help. I am using Excel 2003. I have a spreadsheet with
about 200 rows and 5 columns of data. There are numerous rows that hold
subtotals.

I need to sort based on the subtotals--BUT keep all the rows together that
belong with that subtotal. Is that possible??


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
Subtotals: Nested subtotals below higher subtotal RobN Excel Discussion (Misc queries) 1 July 20th 06 09:04 PM
How do I save & apply sorts subtotals in excel to new worksheets? Kent Excel Discussion (Misc queries) 2 July 13th 05 12:53 AM
How do I copy an outline w/ subtotals & paste just the subtotals av Excel Discussion (Misc queries) 1 June 20th 05 11:35 PM
Problem with nested subtotals, placing secondary subtotals BELOW . Dawn Cameron Excel Discussion (Misc queries) 1 June 3rd 05 10:13 PM
Excel gets subtotals out of order using multiple sorts and subtot. jeffl Excel Discussion (Misc queries) 1 March 29th 05 01:35 AM


All times are GMT +1. The time now is 01:16 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"