+ Reply to Thread
Results 1 to 5 of 5

Dynamic Sorting

  1. #1
    Valued Forum Contributor
    Join Date
    04-21-2005
    Location
    Southern England
    MS-Off Ver
    Excel for Office 365
    Posts
    1,702

    Dynamic Sorting

    Hi,

    On the attached file I have a list of projects which are sorted by region, the regions are:
    TOTAL - EMEA – USD
    TOTAL - Americas – USD
    TOTAL - EMPG – USD

    Within each region I would like to sort the data by column BX to show the most profitable projects at the top of the list. I can do this manually but ideally I would like an automated version if possible?

    Is there any way (macro or formula) in which I can achieve this? E.g. a macro or formula which first defines it’s own index (additional rows will be added), can it be that it looks for each instance of “TOTAL” to define the index last row? Then it sorts, then it moves onto the next region and so on.

    Any help is greatly appreciated.

    Paul
    Attached Files Attached Files

  2. #2
    Forum Expert OllieB's Avatar
    Join Date
    12-20-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2007 (home) & 2010 (office)
    Posts
    1,542

    Re: Dynamic Sorting

    This should work

    Please Login or Register  to view this content.
    If you like my contribution click the star icon!

  3. #3
    Valued Forum Contributor
    Join Date
    04-21-2005
    Location
    Southern England
    MS-Off Ver
    Excel for Office 365
    Posts
    1,702

    Re: Dynamic Sorting

    Hi,

    Thanks for this code - it didnt work, I am just trying to find out why now (if I can). I know its moving the total row which I need to avoid (these lines must remain fixed) e.g. the rows above and below the total lines are the only data that needs to be sorted.

    I notice also that when the data is sorted it becomes corrupt because of the formulas used. Is there any way it can copy and past the data to a new sheet first and then perform the sort?

  4. #4
    Forum Expert OllieB's Avatar
    Join Date
    12-20-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2007 (home) & 2010 (office)
    Posts
    1,542

    Re: Dynamic Sorting

    I have tested my solution against the sample data provided by you and have no problems whatsoever.

  5. #5
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Dynamic Sorting

    See if this formula approach helps, fror the Dynamic Named Ranges used see the Names Manager

    On Sheet "Sorted", column A is an index/ranking for each region, and is hidden with the +/- grouping button.

    Drag A8:B8 down
    Drag L8 across to Column BY, then down

    The TOTALS rows are highlighted with C/F
    Attached Files Attached Files
    If you need any more information, please feel free to ask.

    However,If this takes care of your needs, please select Thread Tools from menu above and set this topic to SOLVED. It helps everybody! ....

    Also
    اس کی مدد کرتا ہے اگر
    شکریہ کہنے کے لئے سٹار کلک کریں
    If you are satisfied by any members response to your problem please consider using the small Star icon bottom left of their post to show your appreciation.

+ 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