# C1.WPF.Excel.XLCell

## Content

<div class="doc-site-dotnet-api-container">



  <h1 id="C1_WPF_Excel_XLCell" data-uid="C1.WPF.Excel.XLCell" class="text-break">XLCell Class
</h1>
  <div class="markdown level0 summary"><p>Represents individual cells in an <a class="xref" href="C1.WPF.Excel.XLSheet.html">XLSheet</a> and provides
properties for getting and setting the cell <a class="xref" href="C1.WPF.Excel.XLCell.Value.html#C1_WPF_Excel_XLCell_Value">Value</a>,
<a class="xref" href="C1.WPF.Excel.XLCell.Style.html#C1_WPF_Excel_XLCell_Style">Style</a>, and <a class="xref" href="C1.WPF.Excel.XLCell.Hyperlink.html#C1_WPF_Excel_XLCell_Hyperlink">Hyperlink</a>.</p>
</div>
  <div class="markdown level0 conceptual"></div>
  <div class="inheritance">
    <h5>Inheritance</h5>
    <div class="level0"><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object">object</a></div>
    <div class="level1"><span class="xref">XLCell</span></div>
  </div>
  <div class="implements">
    <h5>Implements</h5>
    <div><a class="xref" href="C1.WPF.Excel.ICloneable.html">ICloneable</a></div>
  </div>
  <h6><strong>Namespace</strong>: <a class="xref" href="C1.WPF.Excel.html">C1.WPF.Excel</a></h6>
  <h6><strong>Assembly</strong>: C1.WPF.Excel.4.6.2.dll</h6>
  <h5 id="C1_WPF_Excel_XLCell_syntax">Syntax</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public class XLCell : ICloneable</code></pre>
  </div>
  <div class="codewrapper">
    <pre><code class="lang-vbnet hljs">Public Class XLCell
    Implements ICloneable</code></pre>
  </div>
  <h5 id="C1_WPF_Excel_XLCell_remarks"><strong>Remarks</strong></h5>
  <div class="markdown level0 remarks"><pre><code>&lt;p&gt;To create cells, use the &lt;xref href=&quot;C1.WPF.Excel.XLSheet&quot; data-throw-if-not-resolved=&quot;false&quot;&gt;&lt;/xref&gt; indexer (Item property). 
</code></pre>
<p>If the cell already exists, the reference will be returned as usual.
If not, the sheet will create the cell (as well as rows and columns if
necessary) and will return a reference to the new cell.</p>
<p>Because it creates cells automatically, the indexer is especially
useful when creating and populating sheets.</p>
</div>
  <h5 id="C1_WPF_Excel_XLCell_examples"><strong>Examples</strong></h5>
  <p>For example, the code below creates a new <a class="xref" href="C1.WPF.Excel.C1XLBook.html">C1XLBook</a>, then
populates the first sheet with a 10 by 10 multiplication table:</p>
<pre><code class="lang-csharp">C1XLBook book = new C1XLBook();
XLSheet sheet = book.Sheets[0];
for (int r = 0; r &lt; 10; r++)
{
  for (int c = 0; c &lt; 10; c++)
  {
    XLCell cell = sheet[r, c];
	cell.Value = (r+1) * (c+1);
  }
}
book.Save(@"c:\temp\test.xls");</code></pre>
<p>Note how the code simply accesses the cells using the indexer. There's no
need to create any rows, columns, or cells. The indexer takes care of all
that automatically.</p>

  <h3 id="constructors">Constructors
</h3>
  <table class="table table-bordered table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td id="C1_WPF_Excel_XLCell__ctor" data-uid="C1.WPF.Excel.XLCell.#ctor">
          <a class="xref" href="C1.WPF.Excel.XLCell.-ctor.html#C1_WPF_Excel_XLCell__ctor">XLCell()</a>
        </td>
        <td class="markdown level1 summary"></td>
      </tr>
    </tbody>
  </table>
  <h3 id="properties">Properties
</h3>
  <table class="table table-bordered table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td id="C1_WPF_Excel_XLCell_Formula" data-uid="C1.WPF.Excel.XLCell.Formula">
          <a class="xref" href="C1.WPF.Excel.XLCell.Formula.html#C1_WPF_Excel_XLCell_Formula">Formula</a>
        </td>
        <td class="markdown level1 summary"><p>Gets or sets a string that specifies a formula of the cell.</p>
</td>
      </tr>
      <tr>
        <td id="C1_WPF_Excel_XLCell_Hyperlink" data-uid="C1.WPF.Excel.XLCell.Hyperlink">
          <a class="xref" href="C1.WPF.Excel.XLCell.Hyperlink.html#C1_WPF_Excel_XLCell_Hyperlink">Hyperlink</a>
        </td>
        <td class="markdown level1 summary"><p>Gets or sets a string that specifies an action to take when the cell
is clicked.</p>
</td>
      </tr>
      <tr>
        <td id="C1_WPF_Excel_XLCell_Style" data-uid="C1.WPF.Excel.XLCell.Style">
          <a class="xref" href="C1.WPF.Excel.XLCell.Style.html#C1_WPF_Excel_XLCell_Style">Style</a>
        </td>
        <td class="markdown level1 summary"><p>Gets or sets the <a class="xref" href="C1.WPF.Excel.XLStyle.html">XLStyle</a> object associated with the cell.</p>
</td>
      </tr>
      <tr>
        <td id="C1_WPF_Excel_XLCell_Text" data-uid="C1.WPF.Excel.XLCell.Text">
          <a class="xref" href="C1.WPF.Excel.XLCell.Text.html#C1_WPF_Excel_XLCell_Text">Text</a>
        </td>
        <td class="markdown level1 summary"><p>Gets the simple text representation of the current cell value.</p>
</td>
      </tr>
      <tr>
        <td id="C1_WPF_Excel_XLCell_Value" data-uid="C1.WPF.Excel.XLCell.Value">
          <a class="xref" href="C1.WPF.Excel.XLCell.Value.html#C1_WPF_Excel_XLCell_Value">Value</a>
        </td>
        <td class="markdown level1 summary"><p>Gets or sets the value stored in the cell.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h3 id="methods">Methods
</h3>
  <table class="table table-bordered table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td id="C1_WPF_Excel_XLCell_Clone" data-uid="C1.WPF.Excel.XLCell.Clone">
          <a class="xref" href="C1.WPF.Excel.XLCell.Clone.html#C1_WPF_Excel_XLCell_Clone">Clone()</a>
        </td>
        <td class="markdown level1 summary"><p>Creates a copy of the current cell, including the value.</p>
</td>
      </tr>
      <tr>
        <td id="C1_WPF_Excel_XLCell_SetValue_System_Object_C1_WPF_Excel_XLStyle_" data-uid="C1.WPF.Excel.XLCell.SetValue(System.Object,C1.WPF.Excel.XLStyle)">
          <a class="xref" href="C1.WPF.Excel.XLCell.SetValue.html#C1_WPF_Excel_XLCell_SetValue_System_Object_C1_WPF_Excel_XLStyle_">SetValue(object, XLStyle)</a>
        </td>
        <td class="markdown level1 summary"><p>Sets the <a class="xref" href="C1.WPF.Excel.XLCell.Value.html#C1_WPF_Excel_XLCell_Value">Value</a> and <a class="xref" href="C1.WPF.Excel.XLCell.Style.html#C1_WPF_Excel_XLCell_Style">Style</a> properties of a cell.</p>
</td>
      </tr>
    </tbody>
  </table>

</div>
