次の方法で共有


XmlMappedRange.FormatConditions プロパティ

XmlMappedRange コントロールのすべての条件付き書式を表す FormatConditions コレクションを取得します。

名前空間:  Microsoft.Office.Tools.Excel
アセンブリ:  Microsoft.Office.Tools.Excel (Microsoft.Office.Tools.Excel.dll 内)

構文

'宣言
ReadOnly Property FormatConditions As FormatConditions
    Get
FormatConditions FormatConditions { get; }

プロパティ値

型: Microsoft.Office.Interop.Excel.FormatConditions
XmlMappedRange コントロールのすべての条件付き書式を表す FormatConditions コレクションを返します。

次のコード例は、FormatConditions プロパティを使用して、XmlMappedRange の値がセル A1 の値より小さい場合に XmlMappedRange のフォントを変更します。 このコード例では、現在のワークシートに CustomerZipCell という名前の XmlMappedRange が含まれているものと仮定しています。

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", missing].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", missing, missing, missing, missing, missing);

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

.NET Framework セキュリティ

  • 直前の呼び出し元に対する完全な信頼。 このメンバーは、部分的に信頼されているコードから使用することはできません。 詳細については、「部分信頼コードからのライブラリの使用」を参照してください。

参照

参照

XmlMappedRange インターフェイス

Microsoft.Office.Tools.Excel 名前空間