Results 1 to 21 of 21

Macro To Sort Data in a cell range row by row

Threaded View

  1. #1
    Registered User
    Join Date
    02-06-2018
    Location
    Dublin, Ireland
    MS-Off Ver
    Microsoft Office 365 Home Subscription
    Posts
    47

    Macro To Sort Data in a cell range row by row

    Hello To All. I am an older aged newbie to both Excel and Computing in general. I would be extremely grateful for any help in solving my problem as I have spent months getting myself to this stage and now at the very end, I am basically sorting the data manually, which defeats the purpose of my efforts completely. Please forgive my description of my requirements, as I may express them in a non specific manner not being used to the correct Excel terminology.

    The Macro will always start in cell C9, in my example attached there are twelve columns containing data that should be sorted row by row

    There is a sorting pattern that will always be static - Skip, Sort, Sort, Skip, Sort, Sort and so on down the rows

    C9 skip - this row range will always be left unchanged

    C10:N10 sort this 12 cell range - the 13th cell O10 contains the text RE letting the macro know it has reached the end of the row and move to next row

    C11:N11 sort this 12 cell range - the 13th cell O11 contains the text RE letting the macro know it has reached the end of the row and move to next row

    C12 skip - this row range will always be left unchanged

    C13:N13 sort this 12 cell range - the 13th cell O13 contains the text RE letting the macro know it has reached the end of the row and move to next row

    C14:N14 sort this 12 cell range - the 13th cell O13 contains the text RE letting the macro know it has reached the end of the row and move to next row

    Everyday the number of rows changes as do the number of cells in the row range to be sorted

    But the starting cell will always be C9 and the pattern will always be Skip Sort Sort Skip Sort Sort all the way down

    So if there were 441 rows C9:C449

    C9 SKIP
    C10 SORT
    C11 SORT

    C12:C446 SKIP SORT SORT

    C447 SKIP
    C448 SORT
    C449 SORT

    When the last row range has been sorted the word END will always be in the next C cell in the next row, so the macro should finish when it gets to the C cell containg END, with 441 active rows it would find END in cell C450

    With 30 active rows C9:C38 it would find the word END in cell C39 and should stop

    Likewise with the row range across to be sorted, if there were only 4 cells with data to be sorted starting with C9:F9 the text RE would always be in the G column all the way down G9, G10, G11 and so on down the relevant rows

    The data in all cells that are to be sorted is imported from a different workbook so all cells contain a FORMULA linking to this outside workbook

    So in the example attached where you see BLANK this means that there is no visible data in the cell but there is a FORMULA

    All cells to be sorted are formatted as numbers to 2 decimal places

    the data should be rearranged high to low from left to right

    the attached is merely an example and not an actual worksheet but covers what the data looks like pre macro and exactly how it should look after running the macro

    In actuality I could have 40+ worksheets daily with 600+ rows in each to be sorted

    Again I apologise as I know I may not have expressed my requirements in a clear and succinct manner.

    Thanks In Advance for any help forthcoming.
    Attached Files Attached Files

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 data within a date range
    By jackyung in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-14-2018, 01:20 AM
  2. [SOLVED] Macro to sort data range
    By roversfan09 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-04-2016, 01:25 PM
  3. Replies: 1
    Last Post: 05-20-2015, 06:21 AM
  4. Replies: 1
    Last Post: 09-14-2014, 02:10 PM
  5. [SOLVED] Macro to select a data range then apply a custom sort
    By dvsbyknight in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 06-20-2013, 01:50 AM
  6. How to create macro to sort data in dynamic range
    By Luke82 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-10-2013, 06:16 PM
  7. Active X (Macro) to Sort data range to included added rows
    By tims31 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-14-2012, 01:21 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