Class RangeExtensions
Extension methods for ExcelRangeBase
Inheritance
Inherited Members
Namespace: OfficeOpenXml
Assembly: EPPlus.dll
Syntax
public static class RangeExtensions
Methods
SkipColumns(ExcelRangeBase, Int32)
Returns a new range, created by skipping a number of columns from the start.
Declaration
public static ExcelRangeBase SkipColumns(this ExcelRangeBase range, int count)
Parameters
| Type | Name | Description |
|---|---|---|
| ExcelRangeBase | range | The source range |
| System.Int32 | count | The number of columns to skip |
Returns
| Type | Description |
|---|---|
| ExcelRangeBase | The result range |
SkipRows(ExcelRangeBase, Int32)
Returns a new range, created by skipping a number of rows from the start.
Declaration
public static ExcelRangeBase SkipRows(this ExcelRangeBase range, int count)
Parameters
| Type | Name | Description |
|---|---|---|
| ExcelRangeBase | range | The source range |
| System.Int32 | count | The number of rows to skip |
Returns
| Type | Description |
|---|---|
| ExcelRangeBase | The result range |
TakeColumns(ExcelRangeBase, Int32)
Returns a new range, created by taking a number of columns from the start.
If count is greater than number of columns in the source range
the entire source range will be returned.
Declaration
public static ExcelRangeBase TakeColumns(this ExcelRangeBase range, int count)
Parameters
| Type | Name | Description |
|---|---|---|
| ExcelRangeBase | range | The source range |
| System.Int32 | count | The number of columns to take |
Returns
| Type | Description |
|---|---|
| ExcelRangeBase | The result range |
TakeColumnsBetween(ExcelRangeBase, Int32, Int32)
Returns a new range, created by taking a specific number of columns between from the offset parameter.
Declaration
public static ExcelRangeBase TakeColumnsBetween(this ExcelRangeBase range, int offset, int count)
Parameters
| Type | Name | Description |
|---|---|---|
| ExcelRangeBase | range | The source range |
| System.Int32 | offset | Offset of the start-column (zero-based) |
| System.Int32 | count | The number of columns to take |
Returns
| Type | Description |
|---|---|
| ExcelRangeBase | The result range |
TakeRows(ExcelRangeBase, Int32)
Returns a new range, created by taking a number of rows from the start.
If count is greater than number of rows in the source range
the entire source range will be returned.
Declaration
public static ExcelRangeBase TakeRows(this ExcelRangeBase range, int count)
Parameters
| Type | Name | Description |
|---|---|---|
| ExcelRangeBase | range | The source range |
| System.Int32 | count | The number of columns to take |
Returns
| Type | Description |
|---|---|
| ExcelRangeBase | The result range |
TakeRowsBetween(ExcelRangeBase, Int32, Int32)
Returns a new range, created by taking a specific number of rows based on the offset parameter.
Declaration
public static ExcelRangeBase TakeRowsBetween(this ExcelRangeBase range, int offset, int count)
Parameters
| Type | Name | Description |
|---|---|---|
| ExcelRangeBase | range | The source range |
| System.Int32 | offset | Offset of the start-row (zero-based) |
| System.Int32 | count | The number of rows to take |
Returns
| Type | Description |
|---|---|
| ExcelRangeBase | The result range |
TakeSingleCell(ExcelRangeBase, Int32, Int32)
Returns a single cell within a range
Declaration
public static ExcelRangeBase TakeSingleCell(this ExcelRangeBase range, int rowOffset, int columnOffset)
Parameters
| Type | Name | Description |
|---|---|---|
| ExcelRangeBase | range | The source range |
| System.Int32 | rowOffset | Offset of the cell's row within the range (zero-based) |
| System.Int32 | columnOffset | Offset of the cell's column within the range (zero-based) |
Returns
| Type | Description |
|---|---|
| ExcelRangeBase |
TakeSingleColumn(ExcelRangeBase, Int32)
Returns a single column as a new range.
Declaration
public static ExcelRangeBase TakeSingleColumn(this ExcelRangeBase range, int offset)
Parameters
| Type | Name | Description |
|---|---|---|
| ExcelRangeBase | range | The source range |
| System.Int32 | offset | Offset of the column (zero-based) in the source range |
Returns
| Type | Description |
|---|---|
| ExcelRangeBase | The requested row |
TakeSingleRow(ExcelRangeBase, Int32)
Returns a single row as a new range.
Declaration
public static ExcelRangeBase TakeSingleRow(this ExcelRangeBase range, int offset)
Parameters
| Type | Name | Description |
|---|---|---|
| ExcelRangeBase | range | The source range |
| System.Int32 | offset | Offset of the row (zero-based) in the source range |
Returns
| Type | Description |
|---|---|
| ExcelRangeBase | The requested row |