Click or drag to resize

CellRange Class

Represents an object of a rectangular group of worksheet cells.
Inheritance Hierarchy
SystemObject
  SautinSoft.ExcelExcelRange
    SautinSoft.ExcelCellRange

Namespace: SautinSoft.Excel
Assembly: SautinSoft.Excel (in SautinSoft.Excel.dll) Version: 2025.2.6
Syntax
public class CellRange : ExcelRange, IEnumerable

The CellRange type exposes the following members.

Properties
 NameDescription
Public propertyComment Gets or sets comment.
(Overrides ExcelRangeComment)
Public propertyEndPosition Gets name of the last cell in this cell range.
Public propertyFirstColumnIndex Gets index of the first column.
Public propertyFirstRowIndex Gets index of the first row.
Public propertyFormula Gets or sets formula string.
(Overrides ExcelRangeFormula)
Public propertyHeight Gets the height of this range of cells in rows.
Public propertyIsStyleDefault Returns true if all cells in cell range or merged range have default cell style; otherwise, false.
(Overrides ExcelRangeIsStyleDefault)
Public propertyItemString Gets excel cell with the specified full or partial name.
Public propertyItemInt32, Int32 Gets excel cell at the specified relative position.
Public propertyLastColumnIndex Gets index of the last column.
Public propertyLastRowIndex Gets index of the last row.
Public propertyMerged Gets or sets whether cells in this range are merged.
Public propertyStartPosition Gets name of the first cell in this cell range.
Public propertyStyle Gets or sets cell style on one or more excel cells.
(Overrides ExcelRangeStyle)
Public propertyValue Gets or sets the value of a single cell or range of cells.
(Overrides ExcelRangeValue)
Public propertyWidth Gets the width of this range of cells in columns.
Top
Methods
 NameDescription
Public methodCopyTo(String) Copies this cell range to another position in the same worksheet.
Public methodCopyTo(ExcelWorksheet, String) 
Public methodCopyTo(Int32, Int32) Copies this cell range to another position in the same worksheet.
Public methodCopyTo(ExcelWorksheet, Int32, Int32) Copies this cell range to another worksheet.
Public methodEquals Determines whether the specified CellRange is equal to the current CellRange.
(Overrides ObjectEquals(Object))
Public methodFindText Finds the first occurrence of the specified text in the current cell range.
Public methodGetEnumerator Returns an enumerator for the CellRange.
Public methodGetHashCode Returns the hash code of this object.
(Overrides ObjectGetHashCode)
Public methodGetReadEnumerator Returns enumerator for the CellRange.
Public methodGetSubrange(String, String) Returns new cell range using start and end position.
Public methodGetSubrange(Int32, Int32, Int32, Int32) Returns new cell range using absolute indexing.
Public methodGetTypeGets the Type of the current instance.
(Inherited from Object)
Public methodOverlaps Checks if this cell range overlaps with another cell range.
Public methodStatic memberPositionToRowColumn Converts position string ("A1", "BN27", etc.) to row and column index.
Public methodStatic memberRowColumnToPosition Converts row and column index to position string ("A1", "BN27", etc.).
Public methodSetBorders Sets the color and style of the lines according to a specific set of borders in one or more Excel cells.
(Overrides ExcelRangeSetBorders(MultipleBorders, SKColor, LineStyle))
Public methodToString Returns a String that represents the current CellRange.
(Overrides ObjectToString)
Top
Remarks

Cell range is determined by its top (FirstRowIndex), left (FirstColumnIndex), bottom (LastRowIndex) and right (LastColumnIndex) borders. This properties are read-only, so if you require different cell range use one of GetSubrange methods GetSubrangeRelative or GetSubrange). Cells in the range can be merged / unmerged by the use of Merged property.

See Also