+ Reply to Thread
Results 1 to 10 of 10

sorting numbers every 24 rows

  1. #1
    Forum Contributor
    Join Date
    08-03-2012
    Location
    london, england
    MS-Off Ver
    Excel 2003
    Posts
    120

    sorting numbers every 24 rows

    hi,
    I need a macro that sorts the numbers from smallest to largest every 24 rows.

    sorting numbers.xlsx

  2. #2
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: sorting numbers every 24 rows

    This will break your data into 24 row blocks and sort each block
    Please Login or Register  to view this content.
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

  3. #3
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: sorting numbers every 24 rows

    non VBA solution

    d1 =
    Please Login or Register  to view this content.
    and drag down

    I copied the data in column A to column C => paste special => values since you added them with the formula aslect.

    After that just sort on column D and after that sort on column C.

    See the attached file.
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  4. #4
    Forum Contributor
    Join Date
    08-03-2012
    Location
    london, england
    MS-Off Ver
    Excel 2003
    Posts
    120

    Re: sorting numbers every 24 rows

    thanks a lot. how can i do it specifically in column h instead of a coz i got another excel file where all the numbers are placed in column h. thanks
    Quote Originally Posted by mikerickson View Post
    This will break your data into 24 row blocks and sort each block
    Please Login or Register  to view this content.

  5. #5
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: sorting numbers every 24 rows

    change 1 (= column A) in 8 (column H).

  6. #6
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: sorting numbers every 24 rows

    Here's another:

    Please Login or Register  to view this content.
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  7. #7
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: sorting numbers every 24 rows

    Quote Originally Posted by freak11 View Post
    thanks a lot. how can i do it specifically in column h instead of a coz i got another excel file where all the numbers are placed in column h. thanks
    Change this line
    Please Login or Register  to view this content.
    but that will only sort column H, the other columns will be unchanged.
    If you want all the columns to be sorted along with H.

    Please Login or Register  to view this content.

  8. #8
    Forum Contributor
    Join Date
    08-03-2012
    Location
    london, england
    MS-Off Ver
    Excel 2003
    Posts
    120

    Re: sorting numbers every 24 rows

    can you clarify what you mean? I tried it and it didnt work somehow
    Quote Originally Posted by oeldere View Post
    non VBA solution

    d1 =
    Please Login or Register  to view this content.
    and drag down

    I copied the data in column A to column C => paste special => values since you added them with the formula aslect.

    After that just sort on column D and after that sort on column C.

    See the attached file.

  9. #9
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: sorting numbers every 24 rows

    You used the formula aselect.

    That is the reason differant values been taken.

    So i copied the data and paste it as special => values.

    Then I used the formula I offered.

    Try it and it will work.

  10. #10
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: sorting numbers every 24 rows

    My solution and Mike's are nearly identical; did you try either one?

+ 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. Replies: 4
    Last Post: 07-16-2012, 03:28 AM
  2. Sorting numbers then separating odd row,even rows
    By vlady in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 10-08-2011, 09:47 PM
  3. Replies: 5
    Last Post: 07-15-2006, 08:30 PM
  4. [SOLVED] Sorting numbers with differing numbers of digits
    By Trudy in forum Excel General
    Replies: 5
    Last Post: 03-04-2006, 08:35 AM
  5. Sorting texts and numbers as if it was all numbers
    By Werner in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-07-2005, 04:05 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