+ Reply to Thread
Results 1 to 11 of 11

Sorting within boxes

  1. #1
    Valued Forum Contributor
    Join Date
    12-02-2009
    Location
    Austin, Tx
    MS-Off Ver
    Office 365 64-Bit, 2108, build 14326.21018
    Posts
    3,963

    Sorting within boxes

    Okay, there's got to be an easy way to do this.

    See the attached file. This is the end result after copying from a pivot table. It's ALMOST done, but I need to sort the elements within each DeptID/PAC area by the Supervisor Name and the Name fields (Sup first, Name second). I've included a brief sample of how it should be when it's all done.

    I have to do this every week for 12 different reports, so an automated method of doing it would be most welcome. I'd appreciate any help you can give.
    Attached Files Attached Files
    Last edited by jomili; 06-17-2011 at 10:07 AM.

  2. #2
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: Sorting within boxes

    Hi

    If you change the structure of your pivot table to put those 2 items into positions 3 and 4, it should then automatically sort them in the way you want.

    Once you have this data copied out, then it would be much easier to just reposition the columns in the output.

    Is that an option?

    rylo

  3. #3
    Valued Forum Contributor
    Join Date
    12-02-2009
    Location
    Austin, Tx
    MS-Off Ver
    Office 365 64-Bit, 2108, build 14326.21018
    Posts
    3,963

    Re: Sorting within boxes

    That's not really an option, as this structure was selected as the optimum for the users of this report. Not my choice, but I work with what I'm given. But thanks for thinking outside the box.

  4. #4
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: Sorting within boxes

    Hi

    If you can't change the structure of the pivot table, then could you build a second one as the basis for your sorted output? It wouldn't have to even be a permanent one - you could use a macro to build the second table to a temporary workbook / worksheet, then delete it afterwards.

    rylo

  5. #5
    Valued Forum Contributor
    Join Date
    12-02-2009
    Location
    Austin, Tx
    MS-Off Ver
    Office 365 64-Bit, 2108, build 14326.21018
    Posts
    3,963

    Re: Sorting within boxes

    I'm not quite sure how a second PT would help. Can you explain further (sorry, I'm slow; drawing me a picture helps). BTW, IF you include an example, I can't open zipped files. I can post 'em, but can't open 'em. Go figure.

  6. #6
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,294

    Re: Sorting within boxes

    Can you not temporarily reorder the PT, copy and paste then put it back the way it was?
    Or can you fill in the blanks in the first two columns in the table?
    Remember what the dormouse said
    Feed your head

  7. #7
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,294

    Re: Sorting within boxes

    Try this:
    Please Login or Register  to view this content.

  8. #8
    Valued Forum Contributor
    Join Date
    12-02-2009
    Location
    Austin, Tx
    MS-Off Ver
    Office 365 64-Bit, 2108, build 14326.21018
    Posts
    3,963

    Re: Sorting within boxes

    I think I'm pretty dense. I just relooked at Rylo's first post, which is essentially what Romper is saying: create the pivot with Supv Name and Name in columns 3 and 4, copy the pivot to create the final report, then cut those two columns and place where my users like them. Why didn't I understand that before? I think that will work.

  9. #9
    Valued Forum Contributor
    Join Date
    12-02-2009
    Location
    Austin, Tx
    MS-Off Ver
    Office 365 64-Bit, 2108, build 14326.21018
    Posts
    3,963

    Re: Sorting within boxes

    Or I could just use the great little macro that Romper that just posted. Thanks so much; it does exactly what I need it to do.

  10. #10
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,294

    Re: Sorting within boxes



    If you are satisfied with the solution(s) provided, please mark your thread as Solved.

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save

  11. #11
    Valued Forum Contributor
    Join Date
    12-02-2009
    Location
    Austin, Tx
    MS-Off Ver
    Office 365 64-Bit, 2108, build 14326.21018
    Posts
    3,963

    Re: Sorting within boxes

    I am most satisfied! Thanks to both of you; you were giving me the right direction, I just wasn't seeing it. And a special thanks to Romper for creating the macro I needed; that saved me some time. I appreciate it.

+ 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