Table of Contents

Class CellCollection

Namespace
SheetStream
Assembly
SheetStream.dll

Indexer over a sheet's cells for random access. See Cells.

public sealed class CellCollection
Inheritance
CellCollection
Inherited Members

Properties

Dimension

The last row and last column that hold a cell, or (0, 0) on an empty sheet. Handy for appending.

public (int LastRow, int LastColumn) Dimension { get; }

Property Value

(int LastRow, int LastColumn)

Examples

var next = sheet.Cells.Dimension.LastRow + 1;

Existing

The cells that currently exist on the sheet (loaded from the workbook being edited or set through this collection), in row then column order. The list is a snapshot, so cells may be changed or cleared while iterating.

public IEnumerable<ExcelCell> Existing { get; }

Property Value

IEnumerable<ExcelCell>

Examples

var lastRow = sheet.Cells.Existing.Select(c => c.Row).DefaultIfEmpty(0).Max();

this[int, int]

The cell at a 1-based row and column.

public ExcelCell this[int row, int column] { get; }

Parameters

row int
column int

Property Value

ExcelCell

this[string]

The cell at an A1 address such as "B7".

public ExcelCell this[string address] { get; }

Parameters

address string

Property Value

ExcelCell