+ Reply to Thread
Results 1 to 7 of 7

Blockwise sorting of lines

  1. #1
    Forum Contributor
    Join Date
    05-24-2020
    Location
    London
    MS-Off Ver
    Office 365 pro
    Posts
    177

    Blockwise sorting of lines

    Hello together,
    i have a bigger sheet and since the sheet is bigger it exceeds the maximum upload size so here is a link:

    https://www.evernote.com/l/AGASdBWIh...hnFBI5ukf2vB4/

    In this sheet, in the column AX (this column position can be different in the next quarter) from row 20 on (this row position can be different in the next quarter), there is the designation of the quarters from which the data are made.
    If you look at the column AX, you can see that the quarters are mixed up in descending order.
    For example
    Quarter 8
    Quarter 6
    Quarter 7
    Quarter 5

    These and the corresponding lines should be put in a correct order:
    Quarter 8
    Quarter 7
    Quarter 6
    Quarter 5

    But only until the next highest quarter number is reached, so in this case quarter 8.
    Sometimes quarters can be missing, because the data in this quarter were not yet available.

    Conclusion is, all rows should be sorted in the correct descending order until the highest quarter comes again.
    The quarters can go from 1 to 16.
    I have only shown 5-8 here.
    But the principle is always the same: mixed quarters

    Maybe somebody can help me to put the rows in the right order block by block.

    If you have questions I can give you more information.

    Thank you very much and sorry for the big problem.
    I bow before you in gratitude
    Last edited by CoSinus; 11-16-2020 at 09:53 AM.

  2. #2
    Forum Expert
    Join Date
    07-06-2004
    Location
    Northern California
    MS-Off Ver
    2K, 2003, 2010, O365
    Posts
    1,490

    Re: Blockwise sorting of lines

    Ambiguous.

    If the 1st 3 lines were

    Quarter 10
    Quarter 3
    Quarter 12

    would that already be in correct order, or should it become

    Quarter 12
    Quarter 10
    Quarter 3

    or even

    Quarter 10
    Quarter 12
    Quarter 3

    ?

    If some instances of the 1st 3 lines above could be one block 'beginning' with Quarter 12 but other instances could be 2 blocks, sometimes Quarter 10 alone and Quarter 3 sorting below Quarter 12 while other times Quarter 3 sorting below Quarter 10 and Quarter 12 alone, there's be no deterministic way to sort blocks unless there were additional information in other columns.

  3. #3
    Forum Contributor
    Join Date
    05-24-2020
    Location
    London
    MS-Off Ver
    Office 365 pro
    Posts
    177

    Re: Blockwise sorting of lines

    Hi thank you for your question.
    It should become
    Quarter 12
    Quarter 10
    Quarter 3

    Thank you very much

  4. #4
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,525

    Re: Blockwise sorting of lines

    If you want to sort only Col.AX then
    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    05-24-2020
    Location
    London
    MS-Off Ver
    Office 365 pro
    Posts
    177

    Re: Blockwise sorting of lines

    Thank you very much for this awesome VBA.
    Could you please make this work on a current worksheet and not on the specific one called 'Konsolidierung'.

    Can I use it on any other sheet, when there is a colum Ax filled with the quarter data like described above?

    Thanks a lot for your answer & help

  6. #6
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,525

    Re: Blockwise sorting of lines

    1) Change
    Please Login or Register  to view this content.
    to
    Please Login or Register  to view this content.
    2) Change
    Please Login or Register  to view this content.
    to
    Please Login or Register  to view this content.
    3) Change (for the safety of appearance of blank or any irregular data)
    Please Login or Register  to view this content.
    to
    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    05-24-2020
    Location
    London
    MS-Off Ver
    Office 365 pro
    Posts
    177

    Re: Blockwise sorting of lines

    I apologize very much for the late reply.
    I have exchanged everything and it works.

    Thank you very much that helped a lot.

    Many greetings

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. VBA for sorting lines leaving out A, AN and The
    By Gary757 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-25-2019, 04:25 AM
  2. [SOLVED] Is there a way to allow sorting, filters, and inserting lines to Locked sheets?
    By kaplanj23 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-06-2014, 12:49 PM
  3. [SOLVED] Sorting data with lines
    By alex.diederich in forum Excel General
    Replies: 4
    Last Post: 04-02-2013, 09:23 PM
  4. Pivot Table Sorting Automatically Adds Border Lines
    By Psirix in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 02-06-2013, 05:39 PM
  5. Replies: 3
    Last Post: 10-12-2012, 01:55 AM
  6. sorting, finding doubles, blank lines
    By redgreen in forum Excel General
    Replies: 3
    Last Post: 10-12-2009, 05:43 PM
  7. How do I group multiple lines of excel info for easy sorting
    By ericsayang in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 01-12-2006, 04:10 PM

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