+ Reply to Thread
Results 1 to 17 of 17

Sort merged fields

  1. #1
    Registered User
    Join Date
    01-28-2011
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2003
    Posts
    11

    Sort merged fields

    I have a worksheet that I need sorted, the only problem is Column A is connected to 30 other columns. I need column A to be sorted, but I also need all the row data in that column to follow suit. To better put it, I have a tree branch that I wanted moved, but I want all the leaves on that branch to move with it. Have a look at the excel file, you will have a better understanding once you see it. This is a condense file, the one I need sorted is 12000 lines.

    Thanks in advance for helping
    Attached Files Attached Files

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Sort merged fields

    The simple, universal solution is to not merge cells in Excel. If you need to duplicate data, do so.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    01-28-2011
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Sort merged fields

    If it was that simple, I would not have asked. The output file comes merged. Any solutions? Thanks.

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Sort merged fields

    Unmerge all cells

    Select the col A, Ctrl+G (goto), Special, Blanks

    In the formula bar type = then press the up arrow key, then press and hold Ctrl, then press Enter. Now what were blanks in col A duplicate the cell above.

    Select col A (again), copy, paste special, values

    Sort everything by col A.

  5. #5
    Registered User
    Join Date
    01-28-2011
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Sort merged fields

    thanks for the response, I got to the part where you type =, when I did all that, I get "=" in column A. What you mean what were blanks in Col A duplicate the cell above? Sorry, not quite following.

  6. #6
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Sort merged fields

    If you select A2 and type = in the formula bar, and then press the up arrow key, the formula changes to =A1. You're doing that simultaneously in all blank cells.

  7. #7
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Sort merged fields

    To expound on what shg said.

    1. Unmerge all cells (this won't work unless all cells are unmerged)
    2. Select the col A,
    3. Ctrl+G (goto), (F5 works too)
    4. Click on Special then Blanks
    At this point all the blank cells (to the bottom of your range) in Column A will be selected.
    5. Put your cursor in the Formula box (white box on tool bar where you usually see your formula) and type = then Arrow Up. (if this doesn't complete the formula, just type in =A1 in the formula box)
    6. Hit CNTRL + ENTER
    That should fill in all those cells.
    7. Copy, and Paste Special > Values.
    That help?
    Last edited by ChemistB; 03-25-2011 at 03:43 PM.
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  8. #8
    Registered User
    Join Date
    01-28-2011
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Sort merged fields

    When I do Copy, and Paste Special > Values, it goes "That command cannot be used on multiple selections."

  9. #9
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Sort merged fields

    Quote Originally Posted by shg
    In the formula bar type = then press the up arrow key, then press and hold Ctrl, then press Enter. Now what were blanks in col A duplicate the cell above.

    Select col A (again), copy, paste special, values
    Capiche ?

  10. #10
    Registered User
    Join Date
    01-28-2011
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Sort merged fields

    Yes, I did all that but when I sort, only column A gets sorted, and I expand the field.

  11. #11
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Sort merged fields

    Yes, I did all that but when I sort, only column A gets sorted, ...
    Quote Originally Posted by shg
    Sort everything by col A.
    Every step counts, Sarah.

  12. #12
    Registered User
    Join Date
    01-28-2011
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Sort merged fields

    hi, I tried all your steps, i run into an error when I get to "Select col A (again), copy, paste special, values"
    "That command cannot be used on multiple selections."

  13. #13
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Sort merged fields

    Do you have an autofilter on? or hidden rows? Everything must be showing when you do these steps.

  14. #14
    Registered User
    Join Date
    01-28-2011
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Sort merged fields

    I do not have any autofilters or hidden rows, too bad the excel file I uploaded was already sorted, otherwise you guys can test it.

  15. #15
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Sort merged fields

    Worked for me as described in both Excel 2000 and 2007.
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  16. #16
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Sort merged fields

    Please Login or Register  to view this content.
    That means click the header at the top of the column, so that the entire column is selected. You must do this, because after selecting the blanks, you have a disjoint selection, which will give the error you describe.

  17. #17
    Registered User
    Join Date
    01-28-2011
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Sort merged fields

    Yes, it worked, thank you, you guys are amazing.

+ 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