Pivot table sorting

Code Chaser

New Member
Joined
Nov 23, 2016
Messages
8
I would like to sort a column in a pivot table by "A". The column is called memo currently holds values called A,B,C and n/a but I will not always know what the values will be in the future. I need something like
.PivotItems("All").Visible = false
.PivotItems("A").Visible = true

Thanks for the help.

Here is my current code"


'Include A, exclude B, C and N/A

Dim FilterHelp As Integer
For FilterHelp = 2 To .PivotItems.Count
Sheets("pivot by account and memo col").Select
With ActiveSheet.PivotTables("Recon Pivot").PivotFields("Memo")
.PivotItems(FilterHelp-1).Visible = False 'Currently sorts by A and N/A (as opposed to just A)
.PivotItems("A").Visible = True
End With
Next FilterHelp
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.

Forum statistics

Threads
1,214,915
Messages
6,122,217
Members
449,074
Latest member
cancansova

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