Class ExcelRange
A range of cells.
Implements
Inherited Members
Namespace: OfficeOpenXml
Assembly: EPPlus.dll
Syntax
public class ExcelRange : ExcelRangeBase, IEnumerable<ExcelRangeBase>, IEnumerable, IEnumerator<ExcelRangeBase>, IEnumerator, IDisposable
Properties
this[int, int]
Access a single cell
Declaration
public ExcelRange this[int Row, int Col] { get; }
Parameters
| Type | Name | Description |
|---|---|---|
| int | Row | The row |
| int | Col | The column |
Property Value
| Type | Description |
|---|---|
| ExcelRange | A range object |
this[int, int, int, int]
Access a range of cells
Declaration
public ExcelRange this[int FromRow, int FromCol, int ToRow, int ToCol] { get; }
Parameters
| Type | Name | Description |
|---|---|---|
| int | FromRow | Start row |
| int | FromCol | Start column |
| int | ToRow | End Row |
| int | ToCol | End Column |
Property Value
| Type | Description |
|---|---|
| ExcelRange |
this[string]
Access the range using an address
Declaration
public ExcelRange this[string Address] { get; }
Parameters
| Type | Name | Description |
|---|---|---|
| string | Address | The address |
Property Value
| Type | Description |
|---|---|
| ExcelRange | A range object |
Methods
SetFormula(string, bool)
Set the formula for the range.
Declaration
public void SetFormula(string formula, bool asSharedFormula = true)
Parameters
| Type | Name | Description |
|---|---|---|
| string | formula | The formula for the range. |
| bool | asSharedFormula | If the formula should be created as a shared formula. If false each cell will be set individually. This can be useful if the formula returns a dynamic array result. |