Sort new column on pivot refresh

kc.crow

Board Regular
Joined
Jul 7, 2005
Messages
75
Hello,

I have a pivot table that is currently sorting by one of 20 positions codes.

Examples
CEO
SVP
EVP
VP
L12
L11

The data source will normally not contain all 20 possible codes. The position is the column header in the pivot and it is currently set up to display in the order above. However, if a new row is added to the dataset with a position that was not on the existing dataset (say, DIR) or an existing row's position is changed, the "new" position is slotted at the far right of the pivot table. So the column order would be

CEO
SVP
EVP
VP
L12
L11
DIR

even though I would want it to be
CEO
SVP
EVP
VP
DIR
L12
L11

I couldn't find a way via VBA to refresh the column sort. Any ideas?

Thanks in advance.
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.

Forum statistics

Threads
1,223,903
Messages
6,175,286
Members
452,631
Latest member
a_potato

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top