View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
[email protected] nikoletos@gmail.com is offline
external usenet poster
 
Posts: 3
Default Custom Sort a Pivot Table (possibly w/ VBA?)

On Feb 16, 10:40*am, David wrote:
Copy your Pivot table out and paste it somewhere, give it header labels, then
get rid of any totals you have. You can now sort it. Unless you want to give
it a special sort order, you will have to move "Other" manually



" wrote:
This is my challenge:


I have a pivot table that has revenue data by vendor (see example
below).


Vendor * * Revenue
ABC * * * * $124
DCE * * * * $321
OTHERS * *$100
FGH * * * * $20
XXX * * * * *$10


*I need to sort the data by descening revenue with one exception - I
would like to have vendor "Others" show up at the bottom of the pivot
table (see desired result below). I can do this manual by sorting it
and the dragging field "Others" to the bottom, or right clicking it
and selecting Sort-Move to End.


Vendor * * Revenue
DCE * * * * $321
ABC * * * * $124
FGH * * * * $20
XXX * * * * *$10
OTHERS * *$100


Is there a macro I can create to do this? I tried using a Custom List
and/or a calculated field for this but I could not get the desired
result.


The number of vendors varies by country so the size of the pivot table
is not fixed.


If you need additional information, please let me know.


Thanks,


Nik- Hide quoted text -


- Show quoted text -


Thanks. I was trying to avoid doing this manual. I did try recording a
macro but I was stuck on the "position= XX" part which moves the field
to the end and depends on the actual number position (bottom, end,
last didn't work).