XmlMappedRange.FormatConditions-Eigenschaft

Ruft eine FormatConditions-Auflistung ab, die alle bedingten Formatierungen für das XmlMappedRange-Steuerelement enthält.

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

Syntax

'Declaration
ReadOnly Property FormatConditions As FormatConditions
FormatConditions FormatConditions { get; }

Eigenschaftswert

Typ: Microsoft.Office.Interop.Excel.FormatConditions
Eine FormatConditions-Auflistung, die alle bedingten Formatierungen für das XmlMappedRange-Steuerelement enthält.

Beispiele

Im folgenden Codebeispiel wird die FormatConditions-Eigenschaft verwendet, um die Schriftart eines XmlMappedRange zu ändern, wenn der Wert von XmlMappedRange kleiner als der Wert von Zelle A1 ist.In diesem Codebeispiel wird davon ausgegangen, dass das aktuelle Arbeitsblatt einen XmlMappedRange mit dem Namen CustomerZipCell enthält.

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;
}

.NET Framework-Sicherheit

Siehe auch

Referenz

XmlMappedRange Schnittstelle

Microsoft.Office.Tools.Excel-Namespace