ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Excel Programming in VB (https://www.excelbanter.com/excel-programming/276454-excel-programming-vbulletin.html)

Peter Atherton

Excel Programming in VB
 
Sugith

On the Pivot Table, Double-click the field header to be
edited e.g The grey Qty field at the top of the table.

Choose Sum from the drop-down list.

Regards
Peter
-----Original 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

.


Sugith Kumar

Excel Programming in VB
 
Thanks for the quick reply. But here I need to control the
Excel sheet thru the VB Program. Because of the "Count of"
all the values in that field are appearing as 1. They are
actually holding diffrent values like 22.0, 25.2 etc

Thanks
Sugith

Tom Ogilvy

Excel Programming in VB
 
Turn on the macro recorder while you manually do what Peter suggested. That
should give you the attributes you need to work with to control you table.

If all your data is numeric, then excel will default to Sum of, but if there
is non-numeric or I think, even a blank field, it will default to Count of,
so you need to control it explicitly.

--
Regards,
Tom Ogilvy
"Sugith Kumar" wrote in message
...
Thanks for the quick reply. But here I need to control the
Excel sheet thru the VB Program. Because of the "Count of"
all the values in that field are appearing as 1. They are
actually holding diffrent values like 22.0, 25.2 etc

Thanks
Sugith





All times are GMT +1. The time now is 10:17 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com