Creates a Condition of the specified ComparisonType.

 public Condition CreateCondition(Comparison comparisonType, System.String formula)
Public Function CreateCondition(ByVal comparisonType As Comparison, ByVal formula As String) As Condition

A Condition constant representing the type of comparison Excel will use when comparing a cell value to the result of the parameter formula. The comparison type must require only one formula and may be set to one of the following values: Condition.Comparison.FormulaEvaluates, Condition.Comparison.CellValueLessThan, Condition.Comparison.CellValueGreaterThan, Condition.Comparison.CellValueLessThanOrEqualTo, Condition.Comparison.CellValueGreaterThanOrEqualTo, Condition.Comparison.CellValueEqualTo, or Condition.Comparison.CellValueNotEqualTo.

The result of this formula will be compared to each cell value in the set of cells associated with the conditional format.

A Condition object representing the condition created.


          ExcelApplication xla = new ExcelApplication();
          Workbook wb = xla.Create();
          Range rng = wb.Worksheets[0].CreateRange("$B$2:$F$10");
          ConditionalFormat condFmt = wb.CreateConditionalFormat();
          Condition cond =
               condFmt.CreateCondition(
               Condition.Comparison.CellValueGreaterThan,
               "=100");
          Font fnt = cond.Style.Font;
          fnt.Bold = true;
          fnt.Color = wb.Palette.GetClosestColor(100, 100, 255);
          rng.SetConditionalFormat(condFmt);
        

          Dim xla As New ExcelApplication()
          Dim wb As Workbook = xla.Create()
          Dim rng As Range = wb.Worksheets(0).CreateRange("$B$2:$F$10")
          Dim condFmt As ConditionalFormat = wb.CreateConditionalFormat()
          Dim cond As Condition = _
               condFmt.CreateCondition( _
               Condition.Comparison.CellValueGreaterThan, _
               "=100")
          Dim fnt As Font = cond.Style.Font
          fnt.Bold = True
          fnt.Color = wb.Palette.GetClosestColor(100, 100, 255)
          rng.SetConditionalFormat(condFmt)