[]
Gets an IEnumerable that can be used to iterate over the cells in this CellRange.
public IEnumerable<CellRange> Cells { get; }
The code below shows how you can use the Cells property to add all integer values in a given cell range.
var total = 0;
foreach (var cell in rng.Cells)
{
var value = grid[cell.Row, cell.Column];
if (value is int)
{
total += (int)value;
}
}