Remove subtotals in Excel pivot

suvidhasuvidha Member Posts: 117
Hi,
How do i remove Subtotals in Excel pivot table using CAL code??

xlPivotField.Subtotals('Item No.',FALSE);
Din't work!!

Comments

  • [TweaK][TweaK] Member Posts: 14
    Maybe this will help:

    //*** Set Subtotals ***
    autPivotField.Subtotals(1,loptSubTotals = loptSubTotals::Automatic);
    autPivotField.Subtotals(2,loptSubTotals = loptSubTotals::Sum);
    autPivotField.Subtotals(3,loptSubTotals = loptSubTotals::Count);
    autPivotField.Subtotals(4,loptSubTotals = loptSubTotals::Average);
    autPivotField.Subtotals(5,loptSubTotals = loptSubTotals::Max);
    autPivotField.Subtotals(6,loptSubTotals = loptSubTotals::Min);
    autPivotField.Subtotals(7,loptSubTotals = loptSubTotals::Product);
    autPivotField.Subtotals(8,loptSubTotals = loptSubTotals::"Count Nums");
    autPivotField.Subtotals(9,loptSubTotals = loptSubTotals::StdDev);
    autPivotField.Subtotals(10,loptSubTotals = loptSubTotals::StdDevp);
    autPivotField.Subtotals(11,loptSubTotals = loptSubTotals::"Var");
    autPivotField.Subtotals(12,loptSubTotals = loptSubTotals::Varp);

    It's simply the Index with a Boolean.
    Works fine here..

    Make sure you have the right Automation Object-Item selected (e.g.: Field <> Fields)
  • crisnicolascrisnicolas Member Posts: 177
    "&#91 wrote: »
    "]Maybe this will help:

    //*** Set Subtotals ***
    autPivotField.Subtotals(1,loptSubTotals = loptSubTotals::Automatic);

    It's simply the Index with a Boolean.
    Works fine here..

    Even if it's an old post... thanks! That's what I was looking for right now... and it works!
  • EmerikEmerik Member Posts: 50
    autPivotField.Subtotals(1,FALSE);

    It's simply the Index with a Boolean.

    What is the index for? What should the value be?

    Best Regards,
    Emerik
Sign In or Register to comment.