Message-ID: <692515121.9937.1711707101810.JavaMail.web05$@web05> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_9936_722051244.1711707101810" ------=_Part_9936_722051244.1711707101810 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html
A Condition object represents a = condition within a ConditionalF= ormat, a format that Excel will apply to a cell or group of cells if a = specified condition is met.
=20public sealed class Condition=20
Public NotInheritable Class Condition=20
A Condition=
alFormat object contains up to three Condition
objects and=
a Range object repres=
enting the set of cells on which the conditions will be tested.
To create a Condition
object, call one of the Conditi=
onalFormat
object's CreateCondition methods.
ExcelApplication xla =3D new ExcelApplication(); Workbook wb =3D xla.Create(); Range rng =3D wb.Worksheets[0].CreateRange("$B$2:$F$10"); ConditionalFormat condFmt =3D wb.CreateConditionalFormat(); Condition cond =3D condFmt.CreateCondition( Condition.Comparison.CellValueGreaterThan,=20 "=3D100"); Font fnt =3D cond.Style.Font; fnt.Bold =3D true; fnt.Color =3D wb.Palette.GetClosestColor(100, 100, 255); rng.SetConditionalFormat(condFmt);=20
Dim xla As New ExcelApplication() Dim wb As Workbook =3D xla.Create() Dim rng As Range =3D wb.Worksheets(0).CreateRange("$B$2:$F$10") Dim condFmt As ConditionalFormat =3D wb.CreateConditionalFormat() Dim cond As Condition =3D _ condFmt.CreateCondition( _ Condition.Comparison.CellValueGreaterThan, _ "=3D100") Dim fnt As Font =3D cond.Style.Font fnt.Bold =3D true fnt.Color =3D wb.Palette.GetClosestColor(100, 100, 255) rng.SetConditionalFormat(condFmt)=20
Name | =20
Description | =20
---|---|
=20 | Returns the = Condition's Condition.Co= mparison value, which determines whether each cell value will be compar= ed with one or two other values, or if a formula will be evaluated for each= cell. | =20
=20 | If the comparison is between a cell value and tw= o values, this is the minimum value; otherwise this is is the formula to be= evaluated for the condition. | =20
=20 | If the value of Condition.ComparisonType is a comparison between a c=
ell value and two values (e.g., Condition.Comparison.CellValueBet=
ween), Formula2 = sets or returns a formula whose result will be the maximum comparison value= . | =20
=20 | Sets or returns the Style that will be set on conditionally formatted cells w= hen the current Condition is met.= td>=20 |
Name | =20
Description | =20
---|---|
=20 | Applies the specified Style to the Condit= ion's current Style. | =20
=20 | Resets the current Condition's Compa=
rison type and formula. The method takes one formulas, and therefore mu=
st take a Comparison that requires one formulas, such as Comparison.CellValueLessThan. | =20
= =20 | Resets the current Condition's Compa=
rison type and minimum and maximum formulas. The method takes two formu=
las, and therefore must take a Comparison that requires two fo=
rmulas, such as Comparison.CellValueBetween. | =20
Name | =20
Description | =20
---|---|
=20 | The value of Condition.Comparison determines whether the value of a cond= itionally formatted cell will be compared with one or two other values, or = if a formula will be evaluated for each cell. | =20