Xceed Workbooks for .NET v3.0 Documentation
Xceed.Workbooks.NET Assembly / Xceed.Workbooks.NET Namespace / Cell Class
Members Example


In This Topic
    Cell Class
    In This Topic
    A cell represents a rectangle in a Worksheet. Each cell is the intersection of a Row and a Column. It can be accessed by using an address (a combination of a letter and a number, like A1, B2, C3…, where the letter is the Column Id and the number is the Row Id) or by coordinates (by specifying the Row Id first & then the Column Id, for example, 0,0; 2,3; 5;5...). Note that indexes for Rows & Columns always start at 0.
    Syntax
    'Declaration
     
    
    Public Class Cell 
       Inherits StyledWorksheetElement
    'Usage
     
    
    Dim instance As Cell
    public class Cell : StyledWorksheetElement 
    Remarks

    Each cell is the intersection of a Row and a Column.

    It can be accessed by using an address (a combination of a letter and a number, like A1, B2, C3…, where the letter is the Column Id and the number is the Row Id) or by coordinates (by specifying the Row Id first & then the Column Id, for example, 0,0; 2,3; 5;5...).

    Note that indexes for RowsColumns always start at 0.

    Example
    using( var doc = Workbook.Load( "test.xlsx") )
      {
        var worksheet = doc.Worksheets[ 0 ];        
        worksheet.Cells[ "A1" ].Value =  new DateTime( 2021, 7, 1, 10, 22, 33 );  
        worksheet.Cells[0, 1].Formula = “SUM(A2*4%)”;
        doc.Save();
      }
    Inheritance Hierarchy

    System.Object
       Xceed.Workbooks.NET.WorkbookElement
          Xceed.Workbooks.NET.WorksheetElement
             Xceed.Workbooks.NET.StyledWorksheetElement
                Xceed.Workbooks.NET.Cell

    Public Properties
     NameDescription
    Public PropertyGets the address of the Cell.  
    Public PropertyGets the Id of the Column associated with the Cell.  
    Public PropertyGets the Cell's DataType.  
    Public PropertyGets or sets the Cell's DataValidation.  
    Public Property

    Gets or sets the Cell's formula.

     
    Public PropertyGets the Id of the Row associated with the Cell.  
    Public PropertyGets the Style used by the Worksheet element. (Inherited from Xceed.Workbooks.NET.StyledWorksheetElement)
    Public PropertyGets or sets the Cell's value.  
    Top
    Public Methods
     NameDescription
    Public MethodAdds ConditionalFormatting to the Cell.  
    Public MethodStarts the calculation process in order to get a value from the Cell's formula.  
    Public MethodRemoves all ConditionalFormattings from the Cell.  
    Public MethodCopies or cuts a Cell & pastes it into another Cell.  
    Public MethodFormats a specific section of the text with a selected Font.  
    Public MethodGets the Cell's ConditionalFormattings.  
    Public MethodGets the result of the DataValidation process.   
    Public MethodRemoves a specific ConditionalFormatting from the Cell.  
    Top
    Protected Methods
     NameDescription
    Protected Internal MethodOverridden.   
    Protected Internal MethodOverridden.   
    Protected Internal MethodOverridden.   
    Protected Internal Method (Inherited from Xceed.Workbooks.NET.StyledWorksheetElement)
    Protected Internal MethodOverridden.   
    Protected Internal MethodOverridden.   
    Top
    Requirements

    Target Platforms: Windows 11, Windows 10, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

    See Also