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
Description

Excerpt

Sets or returns the Style that will be set on conditionally formatted cells when the current Condition is met.

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 Style Style{ get; set; }
</pre></td></tr></tbody></table>
Signature
vb.net
vb.net
<p>Public Property Style() As Style</p>
Example
Code Block
csharp
csharp
titleC#

          ExcelApplication xla = new ExcelApplication();
          Workbook wb = xla.Create();
          Range rng = wb.Worksheets[0].CreateRange("$B$2:$F$10");
          ConditionalFormat condFmt = wb.CreateConditionalFormat();
          Condition cond =
               condFmt.CreateCondition(
               Condition.Comparison.CellValueGreaterThan,
               "=100");
          Font fnt = cond.Style.Font;
          fnt.Bold = true;
          fnt.Color = wb.Palette.GetClosestColor(100, 100, 255);
          rng.SetConditionalFormat(condFmt);
        
Code Block
vb.net
vb.net
titlevb.net

          Dim xla As New ExcelApplication()
          Dim wb As Workbook = xla.Create()
          Dim rng As Range = wb.Worksheets(0).CreateRange("$B$2:$F$10")
          Dim condFmt As ConditionalFormat = wb.CreateConditionalFormat()
          Dim cond As Condition = _
               condFmt.CreateCondition( _
               Condition.Comparison.CellValueGreaterThan, _
               "=100")
          Dim fnt As Font = cond.Style.Font
          fnt.Bold = true fnt.Color = wb.Palette.GetClosestColor(100, 100, 255)
          rng.SetConditionalFormat(condFmt)