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#
public System.String Formula1{ get; set; }
{signature}{signature:
}
Signature
vb.net
vb.net
Public Property Formula1() As String
{signature}
{remarks}
If the value of [
Remarks

If the value of Condition.ComparisonType

|Condition.ComparisonType]

is

a

comparison

between

a

cell

value

and

a

single

value

\

(e.g.,

[

Condition.Comparison.CellValueEqualTo

|Condition.Comparison#CellValueEqualTo]\

),

[

Formula1

|Condition.Formula1]

sets

or

returns

a

formula

whose

result

will

be

compared

with

each

cell

value

in

the

set

of

conditionally

formatted

cells.

If {{

If Condition.ComparisonType

}}

is

a

comparison

between

a

cell

value

and

two

values

\

(e.g.,

[

Condition.Comparison.CellValueBetween

|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

|Condition.Comparison#FormulaEvaluation]

,

{{

Formula1

}}

sets

or

returns

a

formula

that

evaluates

to

{{

true

}}

or

{{

false

}}. {remarks} {example}{code:csharp|title=C#}

.

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} {code:
Code Block
vb.net
|title=
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"
        
{code} {example}