Question : Excel 2002 PivotTable grand total

Can someone tell me if it is possible to program a PivotTable in Excel XP to display grand total for certain columns?  I tried that but it is either nothing or grand totalling on every column.  Is it possible for me to loop through the grand total 'range', identify the column by specifiying the field name, and then 'black-out' the cells?

Thanks in advance.
Cheers,
Wai-man

Answer : Excel 2002 PivotTable grand total

waiman,
You could set the font color of the total cell to the
background color so that it is not 'visible'

The example bellow assumes the column field is 'b',
therefore: 'Sum of b'

Sub Test()

    Dim pt As PivotTable
    Dim rg As Range
    Dim colorI As Long
   
    'Get pivot table reference
    Set pt = Selection.PivotTable

    'Get column grand total field 'b'
    pt.PivotSelect "'Column Grand Total' 'Sum of b'", _
           xlDataOnly
    Set rg = Selection
   
    'Change color
    colorI = rg.Interior.ColorIndex
    rg.Font.ColorIndex = colorI
End Sub

Hope this helps,
Sébastien
Random Solutions  
 
programming4us programming4us