+ Reply to Thread
Results 1 to 7 of 7

Sort Different sections based on values in a column

  1. #1
    Forum Contributor
    Join Date
    06-01-2012
    Location
    va
    MS-Off Ver
    2007
    Posts
    163

    Sort Different sections based on values in a column

    Hi all,

    I need some help in sorting different sections based on values in a column. I have attached a sample workbook to help show what I am talking about.

    So basically each section will have a different amount of lines everytime and they will be numbered differently, so basically I want a macro that can recognize the different sections (regardless of how many rows) and then sort the rows based on the the values in column smallest to largest.

    -Thanks!
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,612

    Re: Sort Different sections based on values in a column

    1. You should put the section numbers in a separate column (e.g. A) Needs a macro)
    2. Delete the section cells/rows and all those blank rows and sort on department and priority or source (you don't specify). < preferred choice
    you can use conditional fomatting to highlight the start of each new department
    Ben Van Johnson

  3. #3
    Forum Contributor
    Join Date
    06-01-2012
    Location
    va
    MS-Off Ver
    2007
    Posts
    163

    Re: Sort Different sections based on values in a column

    Can this all be done via a macro?

  4. #4
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,612

    Re: Sort Different sections based on values in a column

    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    06-01-2012
    Location
    va
    MS-Off Ver
    2007
    Posts
    163

    Re: Sort Different sections based on values in a column

    Thanks for the code, but it doesn't really work, it only changes one row in the third section. I hit it again and then it changes one row in the second section.

  6. #6
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: Sort Different sections based on values in a column

    Hi Thelegazy,
    try it
    Please Login or Register  to view this content.

  7. #7
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,612

    Re: Sort Different sections based on values in a column

    You didn't specify which column to sort. But nilem's is neater.

+ 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] Macro to sort variable rows of data by a column in multiple sections
    By mannuhs in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-11-2013, 03:22 PM
  2. [SOLVED] sort and delete based on the values in column c and column j?
    By barbibchn in forum Excel General
    Replies: 1
    Last Post: 01-14-2013, 04:25 PM
  3. How do I sort based upon values in another column?
    By Huuuze in forum Excel General
    Replies: 5
    Last Post: 10-27-2010, 10:54 AM
  4. RE: my column is sorted in two sections. How do I sort entire column?
    By Bob Umlas, Excel MVP in forum Excel General
    Replies: 0
    Last Post: 02-13-2006, 04:45 PM
  5. Replies: 0
    Last Post: 02-13-2006, 04:45 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