Propriedade XmlMappedRange.FormatConditions

Obtém uma coleção de FormatConditions que representa todos os formatos condicionais para o controle de XmlMappedRange .

Namespace:  Microsoft.Office.Tools.Excel
Assembly:  Microsoft.Office.Tools.Excel (em Microsoft.Office.Tools.Excel.dll)

Sintaxe

'Declaração
ReadOnly Property FormatConditions As FormatConditions
FormatConditions FormatConditions { get; }

Valor de propriedade

Tipo: Microsoft.Office.Interop.Excel.FormatConditions
Uma coleção de FormatConditions que representa todos os formatos condicionais para o controle de XmlMappedRange .

Exemplos

O exemplo de código a seguir usa a propriedade de FormatConditions para alterar a fonte de XmlMappedRange se o valor de XmlMappedRange é menor que o valor da célula A1.Este exemplo de código a seguir pressupõe que a planilha atual contiver XmlMappedRange chamado CustomerZipCell.

Private Sub ModifyFormatConditions()
    Me.Range("A1").Value2 = 99000
    Me.CustomerZipCell.Value2 = 98052

    ' Set conditional formatting to alter the font and interior pattern if 
    ' the CustomerZipCell value is less than the value in A1.
    Dim condition1 As Excel.FormatCondition = _
        Me.CustomerZipCell.FormatConditions.Add( _
            Excel.XlFormatConditionType.xlCellValue, _
            Excel.XlFormatConditionOperator.xlLess, "=$a$1")

    condition1.Font.Bold = True
    condition1.Font.Color = &HFF00
End Sub
private void ModifyFormatConditions()
{
    this.Range["A1"].Value2 = 99000;
    this.CustomerZipCell.Value2 = 98052;

    // Set conditional formatting to alter the font and interior pattern if 
    // the CustomerZipCell value is less than the value in A1.
    Excel.FormatCondition condition1 = 
        (Excel.FormatCondition)this.CustomerZipCell.FormatConditions.Add(
        Excel.XlFormatConditionType.xlCellValue,
        Excel.XlFormatConditionOperator.xlLess, "=$a$1");

    condition1.Font.Bold = true;
    condition1.Font.Color = 0xFF00;
}

Segurança do .NET Framework

Consulte também

Referência

XmlMappedRange Interface

Namespace Microsoft.Office.Tools.Excel