+ Reply to Thread
Results 1 to 9 of 9

Sort rows and maintain order with second grouped column: Help a nonprofit brother out

  1. #1
    Registered User
    Join Date
    08-14-2012
    Location
    United States
    MS-Off Ver
    Excel 2011
    Posts
    5

    Question Sort rows and maintain order with second grouped column: Help a nonprofit brother out

    Hello

    I need some help making a list for a museum I volunteer at. With my limited excel knowledge I am trying to make a sortable list of donors each with unique grouped fields. I have them grouped so they could be collapsed to make overall viewing easier but If I try to sort them alphabetically I cannot figure out how to link Column B so the fields stay with the sorted column A. I looked around and some similar problems had been sorted via a pivot table or VBA but those days have passed for me and am in need of some assistance.

    I put a small sample of what I am going towards. Is there a way to sort column 1 and have the rows in column 2 stay with what should be their parent in column 1. Thanks

    FoundationInfo.xlsx

  2. #2
    Forum Contributor bentleybob's Avatar
    Join Date
    02-27-2009
    Location
    Seattle, WA
    MS-Off Ver
    Excel 2010
    Posts
    644

    Re: Sort rows and maintain order with second grouped column: Help a nonprofit brother out

    Not quite sure what you have in mind since I don't see a list of donors, but have you tried putting hidden text in the relevant rows in Column A? In your example, it would say "Toyota USA Foundation in cells A3 through A6 but these would not display. Then, if you sorted on Column A, the rows would stay together.

    If this doesn't work, try adding to your sample file but, obviously, use dummy data.

  3. #3
    Registered User
    Join Date
    08-14-2012
    Location
    United States
    MS-Off Ver
    Excel 2011
    Posts
    5

    Re: Sort rows and maintain order with second grouped column: Help a nonprofit brother out

    If I used hidden text would I also have to group cells A2 - A6?
    Last edited by PTHINHK; 08-14-2012 at 06:28 PM.

  4. #4
    Registered User
    Join Date
    08-14-2012
    Location
    United States
    MS-Off Ver
    Excel 2011
    Posts
    5

    Re: Sort rows and maintain order with second grouped column: Help a nonprofit brother out

    Sorry yeah read my post again and is a bit confusing. Basically if I want to sort alphabetically, column A (foundations), my objective is to have the groups in column B (grant information) move as a group, following the foundation where ever it goes. Reasoning is so when more are added and thus sorted (A-Z) all of the information stays with the foundation.

    Reasoning for having groups for the info was to simplify searching and browsing when column B is collapsed. Right now when you sort A-Z column A Column B no longer corresponds. I have done something similar in Access before using a join command or the likes, but I am trying to keep this simple, at least for the front end user.

    Is what I am after possible?

  5. #5
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,524

    Re: Sort rows and maintain order with second grouped column: Help a nonprofit brother out

    Let's see if the attached work for you.
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    08-14-2012
    Location
    United States
    MS-Off Ver
    Excel 2011
    Posts
    5

    Re: Sort rows and maintain order with second grouped column: Help a nonprofit brother out

    Jindon,Hm I tried the attached file and on my end it appears the same as the file that I posted.

    Here is screenshot:ExcelScreenshot.jpg

    When sorting Column A (A-Z) the only change is that 'SIA Foundation' moves from A2 to A6. The second spreadsheet labeled data but it appears blank. What am I missing, could you upload how it looks on your end maybe something is not translating correctly your version to mine.

  7. #7
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,524

    Re: Sort rows and maintain order with second grouped column: Help a nonprofit brother out

    That's strange.

    When I run the code, it will post the result in "result" sheet correctly.

    No idea.

    Here's the code
    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    08-14-2012
    Location
    United States
    MS-Off Ver
    Excel 2011
    Posts
    5

    Re: Sort rows and maintain order with second grouped column: Help a nonprofit brother out

    Thank You! I think there is an issue with the Excel on my laptop, I am now getting a licensing error when I run the macro... Going to try tomorrow morning on a different computer and will post of my hopeful success.

  9. #9
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,933

    Re: Sort rows and maintain order with second grouped column: Help a nonprofit brother out

    as another suggestion, try a helper column with concatenation of your donor and your group, and then base your sort on that? you could put the helper column way out of the way, and then record a macro that would do the sort for you, and add amacro button to do the sorting?
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

+ 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