Hello/Thanks In Advance.
I am trying to find a way to loop thru column headers so that I can use what is found in VBA code to sort into a Pivot Table.
Column headers could be a number of Age combinations:
<tbody>
</tbody>
For example, I want to take any column header that contains text *Boys* - and do the below for me:
With ActiveSheet.PivotTables("PivotTable1").PivotFields("P 18-24 Boys")
.Orientation = xlPageField
.Position = 1
End With
With ActiveSheet.PivotTables("PivotTable1").PivotFields("P 25-54 Boys")
.Orientation = xlPageField
.Position = 1
End With
Thanks
Cathy
I am trying to find a way to loop thru column headers so that I can use what is found in VBA code to sort into a Pivot Table.
Column headers could be a number of Age combinations:
P 18-24 Boys | P 25-54 Boys |
<tbody>
</tbody>
For example, I want to take any column header that contains text *Boys* - and do the below for me:
With ActiveSheet.PivotTables("PivotTable1").PivotFields("P 18-24 Boys")
.Orientation = xlPageField
.Position = 1
End With
With ActiveSheet.PivotTables("PivotTable1").PivotFields("P 25-54 Boys")
.Orientation = xlPageField
.Position = 1
End With
Thanks
Cathy