Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Description

Excerpt

If the comparison is between a cell value and two values, this is the minimum value; otherwise this is is the formula to be evaluated for the condition.

Signature
C#
C#
<table class="diff-macro"><thead><tr><th class="diff-macro-title">unmigrated-wiki-markup</th></tr></thead><tbody><tr><td class="diff-macro-body"><pre>
 public System.String Formula1{ get; set; }
</pre></td></tr></tbody></table>
Signature
vb.net
vb.net
Public <p>Public Property Formula1() As String</p>String
Remarks

If the value of Condition.ComparisonType is a comparison between a cell value and a single value (e.g., Condition.Comparison.CellValueEqualTo), Formula1 sets or returns a formula whose result will be compared with each cell value in the set of conditionally formatted cells.

If Condition.ComparisonType is a comparison between a cell value and two values (e.g., Condition.Comparison.CellValueBetween), Formula1 sets or returns a formula whose result will be the minimum comparison value.

If the value of Condition.ComparisonType is Condition.Comparison.FormulaEvaluation, Formula1 sets or returns a formula that evaluates to true or false.

Example
Code Block
csharp
csharp
titleC#
            ExcelApplication xla = new ExcelApplication();
          Workbook wb = xla.Create();
          ConditionalFormat condFmt = wb.CreateConditionalFormat();
          Condition cond =
               condFmt.CreateCondition(
               Condition.Comparison.CellValueGreaterThan,
               "=100");
          cond.Formula1 = "=99";
        
Code Block
vb.net
vb.net
titlevb.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.Formula1 = "=99"