Excel 97 & Pivot Table

  • Thread starter Thread starter pilmart
  • Start date Start date
P

pilmart

Hi There
I have a couple of problems working with with Excel 97 & pivottables.

1). I am trying to rename a couple of datafields where Excel i
creating field names such as 'Sum of Breach' & 'Count of Call_Ref'
wish to rename them. I have tried code such as
Set myField = myPivot.PivotFields("Breach")
then myfield.name = "NewName" but the value appears to be read-only.

2). I am trying to create a Calculatedfield using code such as
Set slafield = myPivot.CalculatedFields.Add("SLA", "(=x)"). I can fin
little or no info on how to set the formula part of the Calculate
field.

Any help would be appreciate
 
Well my problem now boils down to summing 2 calculatedfields.
I have field1 which is a count of one set of values, field2 which is
sum of another field now I wish to create a new calculatedfield whic
manipulates field1 and Field2 ie :-

Set slafield = myPivot.CalculatedFields.Add("SLA", "=(Field1
Field2)")

But it doesn't appear that you can do this with calculated fields, ha
anybody any idea how I can do this ?
 
You can add a column (e.g. MyCount) to the data, and enter a 1 in each
row. In your calculated field, change the formula to MyCount+Field2, and
you should get the correct total.
 
Many Many thanks, this was exactly what I was looking for
and has solved my problem. Blindingly obvious when you
think about it really.

Once again thankyou
 
Back
Top