View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Kanan Kanan is offline
external usenet poster
 
Posts: 34
Default Pivot table calculated field in data area

Hi,
I am having an issue with a calculated field. By using a checkbox , I pull
a calculated fied into the data area and when unchecked , I want to hide the
calculatedfield out of the data area. My main difficulty is during the
uncheck..Iam using the following stmt. It doesn't seem to work. I would
appreciate if someone can tell me how I can do this.

THe statements below work well with a standard field but not with a
calculated field.

thanks
Kanan

Here is the stmt I use to drag the field to the data area:
ActiveSheet.PivotTables("PivotTable2").AddDataFiel d
ActiveSheet.PivotTables("PivotTable2").PivotFields (Fieldname), " " +
Fieldname, xlSum

the statement to hide the calculated field from the data area is:
ActiveSheet.PivotTables("PivotTable2").PivotFields (Fieldname).Orientation =
xlHidden