Below code is not working.
PT1.CalculatedFields.Add Name:="Conversion", Formula:="Winner / All "
With PT1.PivotFields("Conversion")
.Orientation = xlDataField
.Function = xlSum
.Position = 1
.Caption = "Conversion-1"
.numberformat = "0.00%"
End With
Column Winner and All contain numbers and I am calculating %
New field is not getting created in the data itself.
I am getting error "unable to get pivotfields property of the pivotclass".
I used the same lines in different code and it was working. I am not able to understand what is the mistake here?
-adr12345
PT1.CalculatedFields.Add Name:="Conversion", Formula:="Winner / All "
With PT1.PivotFields("Conversion")
.Orientation = xlDataField
.Function = xlSum
.Position = 1
.Caption = "Conversion-1"
.numberformat = "0.00%"
End With
Column Winner and All contain numbers and I am calculating %
New field is not getting created in the data itself.
I am getting error "unable to get pivotfields property of the pivotclass".
I used the same lines in different code and it was working. I am not able to understand what is the mistake here?
-adr12345