![]() |
Excel Programming in VB
Hi,
You use some thing like this: Worksheets("X").PivotTables("Y").DataFields(1).Cal culation= xlSum -- JP http://www.solutionsvba.com "Sugith Kumar" wrote in message ... I have a code as follows in a VB Subroutine. With .PivotFields("Next Quarter") .Orientation =4 .Position = 7 End With the problem is, the field "Next Quarter" is coming as "Count of" field instead of "Sum of". So all the values in this field are distorted. How do I force this field to "Sum of"? Any idea? A quick reply is appreciable. Thanks Sugith |
Excel Programming in VB
Hi sapta, Peter Atherton, Andy DeVries, Tom Ogilvy and
Jean-Paul Viel - thanks to all of you for suggesting solutions. This worked well. Now I have another problem. I'm creating a chart based on a pivot table. I use ChartType = xlColumnStacked. but for some of the datafield values, I want a different ChartType. How do I do this? In the existing code I use, chtNew.ChartType = xlColumnStacked . Here chtNew is the chart generated from the Pivot table. I'm not specifically setting ChartType for every datafields. Any idea how to have different chart type for different data fields? Thanks in advance Sugith -----Original Message----- Hi, You use some thing like this: Worksheets("X").PivotTables("Y").DataFields (1).Calculation= xlSum -- JP http://www.solutionsvba.com "Sugith Kumar" wrote in message ... I have a code as follows in a VB Subroutine. With .PivotFields("Next Quarter") .Orientation =4 .Position = 7 End With the problem is, the field "Next Quarter" is coming as "Count of" field instead of "Sum of". So all the values in this field are distorted. How do I force this field to "Sum of"? Any idea? A quick reply is appreciable. Thanks Sugith . |
All times are GMT +1. The time now is 10:29 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com