Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 4.0
Description

Excerpt

Resets the current Condition's Comparison type and minimum and maximum formulas. The method takes two formulas, and therefore must take a Comparison that requires two formulas, such as Comparison.CellValueBetween.

Signature
C#C#
Wiki Markup
{description}
{excerpt}Resets the current [Condition|Condition]'s [Comparison|Condition.Comparison] type and minimum and maximum formulas. The method takes two formulas, and therefore must take a {{Comparison}} that requires two formulas, such as [Comparison.CellValueBetween|Condition.Comparison#CellValueBetween].{excerpt}
{signature:C#}
 public void ChangeCondition(Comparison comparisonType, System.String formula1, System.String formula2)
Signature
{signature}{signature:vb.net
vb.net
}
Public Sub ChangeCondition(ByVal comparisonType As Comparison, ByVal formula1 As String, ByVal formula2 As String)
Parameters
{signature}
{parameters}
{param:comparisonType}The type of comparison Excel will use when comparing a cell value to {{formula1}} and {{formula2}}. The comparison type must require two formulas and may be set to one of the following values: {{Comparison.CellValueBetween}} or [Comparison.CellValueNotBetween|Condition.Comparison#CellValueNotBetween].{param}
{param:formula1}The formula to use for the minumum value.{param}
{param:formula2}The formula to use for the maximum value.{param}
{example}{code:csharp|title=C#}

          ExcelApplication xla = new ExcelApplication();
          Workbook wb = xla.Create();
          ConditionalFormat condFmt = wb.CreateConditionalFormat();
          Condition cond =
               condFmt.CreateCondition(
               Condition.Comparison.CellValueGreaterThan,
               "=100");
          cond.ChangeCondition(
               Condition.Comparison.CellValueBetween,
               "=100",
               "=150");
        
{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.CellValueGreaterThan, _
               "=100")
          cond.ChangeCondition( _
               Condition.Comparison.CellValueBetween, _
               "=100", _
               "=150")
        {code}

{example}
Param
comparisonTypecomparisonType

The type of comparison Excel will use when comparing a cell value to formula1 and formula2. The comparison type must require two formulas and may be set to one of the following values: Comparison.CellValueBetween or Comparison.CellValueNotBetween.

Param
formula1formula1

The formula to use for the minumum value.

Param
formula2formula2

The formula to use for the maximum value.

Example
Code Block
csharpcsharp
titleC#
Code Block
vb.nettitle