Hi there, is there a way to remove all of the available measures rather than listing each one as below ?
Please see below for some sample code.
ActiveSheet.PivotTables("PivotTable1").CubeFields("[Measures].[XXX1]").Orientation = xlHidden
ActiveSheet.PivotTables("PivotTable1").CubeFields("[Measures].[XXX2]").Orientation = xlHidden
ActiveSheet.PivotTables("PivotTable1").CubeFields("[Measures].[XXX3]").Orientation = xlHidden
etc, all the way to about 70.
This removes the measures that I would like. Except i have to specifically name them. Is there a way to remove all measures using one bit of code, or do I have to name them to get them removed?
Thanks in advance.
Please see below for some sample code.
ActiveSheet.PivotTables("PivotTable1").CubeFields("[Measures].[XXX1]").Orientation = xlHidden
ActiveSheet.PivotTables("PivotTable1").CubeFields("[Measures].[XXX2]").Orientation = xlHidden
ActiveSheet.PivotTables("PivotTable1").CubeFields("[Measures].[XXX3]").Orientation = xlHidden
etc, all the way to about 70.
This removes the measures that I would like. Except i have to specifically name them. Is there a way to remove all measures using one bit of code, or do I have to name them to get them removed?
Thanks in advance.