Expand Minimize
This topic has not yet been rated - Rate this topic

Worksheet.ConsolidationFunction Property (2007 System)

Gets the function code used for the current consolidation.

Namespace:  Microsoft.Office.Tools.Excel
Assembly:  Microsoft.Office.Tools.Excel.v9.0 (in Microsoft.Office.Tools.Excel.v9.0.dll)
public XlConsolidationFunction ConsolidationFunction { get; }

Property Value

Type: XlConsolidationFunction
One of the XlConsolidationFunction values.

The following code example uses the ConsolidationFunction property to determine which function is used by the worksheet for consolidation.

This example is for a document-level customization.

private void ShowConsolidationFunction()
{
    string simpleName;

    switch (this.ConsolidationFunction)
    {
        case Excel.XlConsolidationFunction.xlSum:
            simpleName = "Sum()";
            break;

        case Excel.XlConsolidationFunction.xlMax:
            simpleName = "Max()";
            break;

        case Excel.XlConsolidationFunction.xlProduct:
            simpleName = "Product()";
            break;

        default:
            simpleName = "Other";
            break;
    }
    MessageBox.Show("This worksheet uses " + simpleName +
        " for the consolidation function.");
}
Did you find this helpful?
(1500 characters remaining)

Community Additions

ADD
© 2013 Microsoft. All rights reserved.