FormatCondition Interface 

Represents a conditional format.

Namespace: Microsoft.Office.Interop.Excel
Assembly: Microsoft.Office.Interop.Excel (in microsoft.office.interop.excel.dll)

Usage

Public Class ormatConditionImplementation
    Implements FormatCondition
End Class
Dim ormatConditionImplementation1 As New ormatConditionImplementation()

Syntax

Public Interface FormatCondition
public interface FormatCondition
public interface class FormatCondition
public interface FormatCondition
public interface FormatCondition

Remarks

The FormatCondition object is a member of the FormatConditions collection. The FormatConditions collection can contain up to three conditional formats for a given range.

Use FormatConditions(index), where index is the index number of the conditional format, to return a FormatCondition object.

Use the Add method to create a new conditional format. If you try to create more than three conditional formats for a single range, the Add method fails. If a range has three formats, you can use the Modify method to change one of the formats, or you can use the Delete method to delete a format and then use the Add method to create a new format.

Use the Font, Borders, and Interior properties of the FormatCondition object to control the appearance of formatted cells. Some properties of these objects aren’t supported by the conditional format object model. The properties that can be used with conditional formatting are listed in the following table.

Object

Properties

Font

Bold

Color

ColorIndex

FontStyle

Italic

Strikethrough

Underline

The accounting underline styles cannot be used.

Border

Bottom

Color

Left

Right

Style

The following border styles can be used (all others aren’t supported): xlNone, xlSolid, xlDash, xlDot, xlDashDot, xlDashDotDot, xlGray50, xlGray75, and xlGray25.

Top

Weight

The following border weights can be used (all others aren’t supported): xlWeightHairline and xlWeightThin.

Interior

Color

ColorIndex

Pattern

PatternColorIndex

Platforms

Development Platforms

Windows XP Home Edition, Windows XP Professional, Windows Server 2003, and Windows 2000

Target Platforms

See Also

Reference

Microsoft.Office.Interop.Excel Namespace

Other Resources

FormatCondition Members