+ Reply to Thread
Results 1 to 2 of 2

Sorting ruins order of Total

  1. #1
    Registered User
    Join Date
    06-11-2012
    Location
    Toronto
    MS-Off Ver
    Excel 2010
    Posts
    7

    Sorting ruins order of Total

    My problem is after sorting by column a, then, b, then c. I have to manually cut and insert the line that contains the word "Total" to match with the last item of that category:
    To give an example: my sheet would have something like

    Group 1 Group 2 Group 3
    a efco gb01
    a efco gb02
    a efco EFCO Total
    a efco gb03
    a abcd gb04
    a abcd ABCD Total
    a abcd gb05
    a abcd gb06


    The result I want is to move EFCO total and ABCD total to align with the last occurance of EFCO and ABCD in column B (Group 2) as follows:

    Group 1 Group 2 Group 3
    a efco gb01
    a efco gb02
    a efco gb03
    a efco EFCO Total
    a abcd gb04
    a abcd gb05
    a abcd gb06
    a abcd ABCD Total



    The code I have below comes from the recorder. It is just basic formatting. I need to get the code to embed somewhere below, I guess after the sorting happens.
    Also notice how I have ranges (A2:A2035) etc. I'm sure there's a better way to write the code to just set the entire column as the range just in case there are times when I have more data than 2035 rows. How would I change that?

    Thank you Excel gurus!


    Please Login or Register  to view this content.
    Last edited by Cutter; 08-24-2012 at 06:47 PM. Reason: Added code tags

  2. #2
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Sorting ruins order of Total

    @ stryder1587

    Welcome to the forum.

    Please notice that code tags have been added to your post(s). The forum rules require them so please keep that in mind and add them yourself whenever showing code in any of your future posts. To see instructions for applying them, click on the Forum Rules button at top of the page and read Rule #3.
    Thanks.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1