![]() |
counting pivot table subfields
I want to write macro to cycle through every subcategory in pivot table.
I have the pivot table broken out by category "8TA", so there is a pull down menu for each of my companies 8 technical areas. I recorded a macro and found out that to select a subcategory, I can use: ActiveChart.PivotLayout.PivotTable.PivotFields("8T A").CurrentPage = "MSS" However to complete a macro do loop, I need to be able to count the number of subareas (which in this case I know is 8), and then reference them separately. Neither of these tow count statements works: Count = ActiveChart.PivotLayout.PivotTable.PivotFields("8T A").Count Count = ActiveChart.PivotLayout.PivotTable.PivotFields("8T A").CurrentPage.Count -- Richard |
counting pivot table subfields
ActiveChart.PivotLayout.PivotTable.PivotFields("8T A").PivotItems.Count
-- Regards, Tom Ogilvy "Richard" wrote in message ... I want to write macro to cycle through every subcategory in pivot table. I have the pivot table broken out by category "8TA", so there is a pull down menu for each of my companies 8 technical areas. I recorded a macro and found out that to select a subcategory, I can use: ActiveChart.PivotLayout.PivotTable.PivotFields("8T A").CurrentPage = "MSS" However to complete a macro do loop, I need to be able to count the number of subareas (which in this case I know is 8), and then reference them separately. Neither of these tow count statements works: Count = ActiveChart.PivotLayout.PivotTable.PivotFields("8T A").Count Count = ActiveChart.PivotLayout.PivotTable.PivotFields("8T A").CurrentPage.Count -- Richard |
counting pivot table subfields
Thanks.
Where can I find similar info for myself? I would also like to adjust font size for x,y labels and for the pivot table pull down menu showing PivotFields("8TA") - right now the graph's various fonts are not ideally sized for export to a PowerPoint presentation. -- Richard "Tom Ogilvy" wrote: ActiveChart.PivotLayout.PivotTable.PivotFields("8T A").PivotItems.Count -- Regards, Tom Ogilvy "Richard" wrote in message ... I want to write macro to cycle through every subcategory in pivot table. I have the pivot table broken out by category "8TA", so there is a pull down menu for each of my companies 8 technical areas. I recorded a macro and found out that to select a subcategory, I can use: ActiveChart.PivotLayout.PivotTable.PivotFields("8T A").CurrentPage = "MSS" However to complete a macro do loop, I need to be able to count the number of subareas (which in this case I know is 8), and then reference them separately. Neither of these tow count statements works: Count = ActiveChart.PivotLayout.PivotTable.PivotFields("8T A").Count Count = ActiveChart.PivotLayout.PivotTable.PivotFields("8T A").CurrentPage.Count -- Richard |
All times are GMT +1. The time now is 08:35 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com