+ Reply to Thread
Results 1 to 7 of 7

Data sorting question

  1. #1
    Registered User
    Join Date
    08-06-2007
    Posts
    22

    Data sorting question

    I need to be able to sort data based on the number in col A but I have merged cells in the range and also outlines that I want to keep intact and move with the data. Any ideas? I have added the example.
    Attached Files Attached Files

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Using Merged Cells especially with VBA will always cause problems. Avoid them, try using Centre across selection instead.

    Your spreadsheet design is not compatible with Excel's Sort feature.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259
    Hello Markdill,

    After looking at your workbook, I didn't find any merged cells. Did you post the correct workbook? Are you wanting to sort only the STC# values in column "A" that are outlined?

    Thanks,
    Leith Ross

  4. #4
    Registered User
    Join Date
    08-06-2007
    Posts
    22

    sort help

    Leith,

    You are right I removed them thinking it was messing up the sort.

    Yes I want to sort the data by COL. A "SCT#" but I want to keep the data in all of the rows the way it is just sort/move the blocks of data if you will. That is the hard part with the outlines.

    So the data is made up of many blocks i.e. - A7 to L9 is one of these "Blocks" and as you can see they are just copied and then the data is changed or added in them.

    I want to sort these "blocks" by the value in COL. A but keep the data in the blocks, maybe move the blocks? I do not know.

    I know how to do a normal sort but the way I need to keep the data in the same location within the blocks and just move/sort the blocks depending on COL. A is what has me stumped.

    Thank for your help.

  5. #5
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259
    Hello Markdill,

    Should I use the workbook you posted originally, or wait for you to post another copy with the merged cells?

    Sincerely,
    Leith Ross

  6. #6
    Registered User
    Join Date
    08-06-2007
    Posts
    22

    Smile Data Sort

    You can use the one I sent, that is the one that is the most current. Feel free to edit it as you need to get it working.

    Thanks

  7. #7
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259
    Hello Markdill,

    The macro below sorts the data and copies it to the worksheet named "Sorted Data". The original data remains intact. The macro shown here has been installed in the attached workbook. By the way, the merged cells pose no sorting problem for this macro.

    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross
    Attached Files Attached Files
    Last edited by Leith Ross; 09-07-2007 at 03:26 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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