+ Reply to Thread
Results 1 to 12 of 12

Sort list based on all columns

  1. #1
    Forum Expert
    Join Date
    09-01-2012
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    2,844

    Sort list based on all columns

    I have a list of multiple columns.
    I want to sort the list based on all columns.
    Only strings that are equal can be on the same row is one way of describing it.
    Quite easy concept really, there is a before and after table in the attachment.
    Attached Files Attached Files
    <----- If you were helped by my posts you can say "Thank you" by clicking the star symbol down to the left

    If the problem is solved, finish of the thread by clicking SOLVED under Thread Tools
    I don't wish to leave you with no answer, yet I sometimes miss posts. If you feel I forgot you, remind me with a PM or just bump the thread.

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

    Re: Sort list based on all columns

    For the data provided
    Please Login or Register  to view this content.

  3. #3
    Forum Expert
    Join Date
    09-01-2012
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    2,844

    Re: Sort list based on all columns

    Wow! It works perfectly on the sample data! Very impressive!

    I forgot to include, sometimes the data is very compact, almost no empty cells. With compact data the macro needs to add rows to the table as needed.

    Also sometimes there are too many rows in the table ("fluffy data"), then the macro needs to remove rows as needed.

    Can you make it work on this too?
    Attached Files Attached Files

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

    Re: Sort list based on all columns

    Do you mean?
    Please Login or Register  to view this content.

  5. #5
    Forum Expert
    Join Date
    09-01-2012
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    2,844

    Re: Sort list based on all columns

    Yes, this works excellent for the compact data!

    However with Fluffy data it needs to remove empty rows that exist from beginning and also empty rows that are created when sorting.
    I assume this will be an easy task for you also?

    This will be final request.
    Attached Files Attached Files

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

    Re: Sort list based on all columns

    This time I need to see your desired result.

  7. #7
    Forum Expert
    Join Date
    09-01-2012
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    2,844

    Re: Sort list based on all columns

    Ok, here is sample data Before and After.
    Attached Files Attached Files

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

    Re: Sort list based on all columns

    This is different from one before.

    Latest, columns have unique within one column, but duplicates in one before...

  9. #9
    Forum Expert
    Join Date
    09-01-2012
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    2,844

    Re: Sort list based on all columns

    Ok, my mistake. My data does not contain duplicates within a column.

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

    Re: Sort list based on all columns

    Then just change one line
    Please Login or Register  to view this content.
    to
    Please Login or Register  to view this content.

  11. #11
    Forum Expert
    Join Date
    09-01-2012
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    2,844

    Re: Sort list based on all columns

    Ok this looks more like black magic than VBA to me.
    But I implemented it and it works perfectly well!
    Thank you so much for all your assistance!

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

    Re: Sort list based on all columns

    You are welcome and thanks for the rep.

+ 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. [SOLVED] Sort columns B,C,D based on column B then loop to next 3 columns and repeat till last colu
    By Andy15 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 04-09-2017, 05:35 PM
  2. Sort list so adjacent columns match
    By ChrisCD in forum Excel General
    Replies: 4
    Last Post: 03-27-2017, 03:09 PM
  3. [SOLVED] How to sort a CSV 'messy' csv address list into neat columns?
    By PHP_Idiot in forum Excel General
    Replies: 4
    Last Post: 05-31-2016, 09:02 AM
  4. Need to Sort Columns in Summary Sheet Based on Priority Columns
    By Kandavalli.Kiran in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-16-2015, 09:47 PM
  5. To sort 3 columns with a priority list
    By Raury in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-08-2014, 10:52 AM
  6. Vba to sort multiple columns as one list
    By FrostByte4 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-04-2012, 12:30 AM
  7. sort columns based on matching 1st & 2nd columns
    By repke in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 02-13-2011, 01:37 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