Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin
Wiki Markup
{description}
{excerpt}Resets the current [Condition|Condition]'s [Comparison|Condition.Comparison] type and formula. The method takes one formulas, and therefore must take a {{Comparison}} that requires one formulas, such as [Comparison.CellValueLessThan|Condition.Comparison#CellValueLessThan].{excerpt}
{signature:C#}
 public void ChangeCondition(Comparison comparisonType, System.String formula)
{signature}{signature:vb.net}
Public Sub ChangeCondition(ByVal comparisonType As Comparison, ByVal formula As String)
{signature}
{parameters}
{param:comparisonType}The type of comparison Excel will use when comparing a cell value to the result of {{formula}}. The comparison type must require only one formula and may be set to one of the following values: [Comparison.FormulaEvaluates|Condition.Comparison#FormulaEvaluates], {{Comparison.CellValueLessThan}}, [Comparison.CellValueGreaterThan|Condition.Comparison#CellValueGreaterThan], [Comparison.CellValueLessThanOrEqualTo|Condition.Comparison#CellValueLessThanOrEqualTo], [Comparison.CellValueGreaterThanOrEqualTo|Condition.Comparison#CellValueGreaterThanOrEqualTo], [Comparison.CellValueEqualTo|Condition.Comparison#CellValueEqualTo], or [Comparison.CellValueNotEqualTo|Condition.Comparison#CellValueNotEqualTo].{param}
{param:formula}The result of this formula will be compared to each cell value in the set of cells associated with the conditional format.{param}
{example}{code:csharp|title=C#}

          ExcelApplication xla = new ExcelApplication();
          Workbook wb = xla.Create();
          ConditionalFormat condFmt = wb.CreateConditionalFormat();
          Condition cond =
               condFmt.CreateCondition(
               Condition.Comparison.CellValueBetween,
               "=100",
               "=150");
          cond.ChangeCondition(
               Condition.Comparison.CellValueGreaterThan, "=100");
        {code}
{code:vb.net|title=vb.net}

          Dim xla As New ExcelApplication()
          Dim wb As Workbook = xla.Create()
          Dim condFmt As ConditionalFormat = wb.CreateConditionalFormat()
          Dim cond As Condition = _
               condFmt.CreateCondition( _
               Condition.Comparison.CellValueBetween, _
               "=100", _
               "=150")
          cond.ChangeCondition( _
               Condition.Comparison.CellValueGreaterThan, "=100")
        {code}

{example}