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