Custom Sort a Pivot Table (possibly w/ VBA?)

N

nikoletos

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
 
D

David

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
 
N

nikoletos

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












- 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).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top