Aracılığıyla paylaş


NamedRange.FormatConditions Özellik

Alır bir FormatConditions Tüm koşullu biçimler için temsil eden koleksiyonu NamedRange Denetim.

Ad alanı:  Microsoft.Office.Tools.Excel
Derleme:  Microsoft.Office.Tools.Excel (Microsoft.Office.Tools.Excel.dll içinde)

Sözdizimi

'Bildirim
ReadOnly Property FormatConditions As FormatConditions
    Get
FormatConditions FormatConditions { get; }

Özellik Değeri

Tür: Microsoft.Office.Interop.Excel.FormatConditions
A FormatConditions Tüm koşullu biçimler için temsil eden koleksiyonu NamedRange Denetim.

Örnekler

Aşağıdaki kod örneği oluşturur bir NamedRange ve kullanır FormatConditions yazı tipini değiştirmek için özellik NamedRange , değeri NamedRange az değeri hücre A1.

Bu örnek, bir belge düzeyinde özelleştirme için bulunur.

Private formatConditionsRange As Microsoft.Office.Tools.Excel.NamedRange

Private Sub ModifyFormatConditions()
    formatConditionsRange = Me.Controls.AddNamedRange( _
        Me.Range("B1"), "formatConditionsRange")
    Me.Range("A1").Value2 = 99000
    Me.formatConditionsRange.Value2 = 98052

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

    condition1.Font.Bold = True
    condition1.Font.Color = &HFF00
End Sub
Microsoft.Office.Tools.Excel.NamedRange formatConditionsRange;
private void ModifyFormatConditions()
{
    formatConditionsRange = this.Controls.AddNamedRange(
        this.Range["B1", missing], "formatConditionsRange");
    this.Range["A1", missing].Value2 = 99000;
    this.formatConditionsRange.Value2 = 98052;

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

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

.NET Framework Güvenliği

Ayrıca bkz.

Başvuru

NamedRange Arabirim

Microsoft.Office.Tools.Excel Ad Alanı