Interface IXLRange
public interface IXLRange : IXLRangeBase, IXLAddressable
- Inherited Members
- Extension Methods
Properties
SortColumns
IXLSortElements SortColumns { get; }
Property Value
SortRows
IXLSortElements SortRows { get; }
Property Value
Methods
AsTable()
Use this range as a table, but do not add it to the Tables list
IXLTable AsTable()
Returns
Remarks
NOTES:
The AsTable method will use the first row of the range as a header row.
If this range contains only one row, then an empty data row will be inserted into the returned table.
AsTable(string)
Use this range as a table with the passed name, but do not add it to the Tables list
IXLTable AsTable(string name)
Parameters
namestringTable name to be used.
Returns
Remarks
NOTES:
The AsTable method will use the first row of the range as a header row.
If this range contains only one row, then an empty data row will be inserted into the returned table.
Cell(IXLAddress)
Gets the cell at the specified address.
IXLCell Cell(IXLAddress cellAddressInRange)
Parameters
cellAddressInRangeIXLAddressThe cell address in the parent range.
Returns
Cell(int, int)
Gets the cell at the specified row and column.
The cell address is relative to the parent range.
IXLCell Cell(int row, int column)
Parameters
Returns
Cell(int, string)
Gets the cell at the specified row and column.
The cell address is relative to the parent range.
IXLCell Cell(int row, string column)
Parameters
Returns
Cell(string)
Gets the cell at the specified address.
IXLCell Cell(string cellAddressInRange)
Parameters
cellAddressInRangestringThe cell address in the parent range.
Returns
Clear(XLClearOptions)
Clears the contents of this range.
IXLRange Clear(XLClearOptions clearOptions = XLClearOptions.All)
Parameters
clearOptionsXLClearOptionsSpecify what you want to clear.
Returns
Column(int)
Gets the specified column of the range.
IXLRangeColumn Column(int columnNumber)
Parameters
columnNumberint1-based column number relative to the first column of this range.
Returns
- IXLRangeColumn
The relevant column
Column(string)
Gets the specified column of the range.
IXLRangeColumn Column(string columnLetter)
Parameters
columnLetterstringColumn letter.
Returns
ColumnCount()
Gets the number of columns in this range.
int ColumnCount()
Returns
Columns(Func<IXLRangeColumn, bool>)
Gets a collection of all columns in this range.
IXLRangeColumns Columns(Func<IXLRangeColumn, bool> predicate = null)
Parameters
predicateFunc<IXLRangeColumn, bool>
Returns
Columns(int, int)
Gets a collection of the specified columns in this range.
IXLRangeColumns Columns(int firstColumn, int lastColumn)
Parameters
firstColumnintThe first column to return. 1-based column number relative to the first column of this range.
lastColumnintThe last column to return. 1-based column number relative to the first column of this range.
Returns
Columns(string)
Gets a collection of the specified columns in this range, separated by commas.
e.g. Columns("G:H"), Columns("10:11,13:14"), Columns("P:Q,S:T"), Columns("V")
IXLRangeColumns Columns(string columns)
Parameters
columnsstringThe columns to return.
Returns
Columns(string, string)
Gets a collection of the specified columns in this range.
IXLRangeColumns Columns(string firstColumn, string lastColumn)
Parameters
Returns
- IXLRangeColumns
The relevant columns
ColumnsUsed(XLCellsUsedOptions, Func<IXLRangeColumn, bool>)
IXLRangeColumns ColumnsUsed(XLCellsUsedOptions options, Func<IXLRangeColumn, bool> predicate = null)
Parameters
optionsXLCellsUsedOptionspredicateFunc<IXLRangeColumn, bool>
Returns
ColumnsUsed(Func<IXLRangeColumn, bool>)
IXLRangeColumns ColumnsUsed(Func<IXLRangeColumn, bool> predicate = null)
Parameters
predicateFunc<IXLRangeColumn, bool>
Returns
CopyTo(IXLCell)
IXLRange CopyTo(IXLCell target)
Parameters
targetIXLCell
Returns
CopyTo(IXLRangeBase)
IXLRange CopyTo(IXLRangeBase target)
Parameters
targetIXLRangeBase
Returns
CreateTable()
IXLTable CreateTable()
Returns
CreateTable(string)
IXLTable CreateTable(string name)
Parameters
namestring
Returns
Delete(XLShiftDeletedCells)
Deletes this range and shifts the surrounding cells accordingly.
void Delete(XLShiftDeletedCells shiftDeleteCells)
Parameters
shiftDeleteCellsXLShiftDeletedCellsHow to shift the surrounding cells.
FindColumn(Func<IXLRangeColumn, bool>)
Returns the first row that matches the given predicate
IXLRangeColumn FindColumn(Func<IXLRangeColumn, bool> predicate)
Parameters
predicateFunc<IXLRangeColumn, bool>
Returns
FindRow(Func<IXLRangeRow, bool>)
Returns the first row that matches the given predicate
IXLRangeRow FindRow(Func<IXLRangeRow, bool> predicate)
Parameters
predicateFunc<IXLRangeRow, bool>
Returns
FirstColumn(Func<IXLRangeColumn, bool>)
Gets the first column of the range.
IXLRangeColumn FirstColumn(Func<IXLRangeColumn, bool> predicate = null)
Parameters
predicateFunc<IXLRangeColumn, bool>
Returns
FirstColumnUsed(XLCellsUsedOptions, Func<IXLRangeColumn, bool>)
Gets the first non-empty column of the range that contains a cell with a value.
IXLRangeColumn FirstColumnUsed(XLCellsUsedOptions options, Func<IXLRangeColumn, bool> predicate = null)
Parameters
optionsXLCellsUsedOptionsThe options to determine whether a cell is used.
predicateFunc<IXLRangeColumn, bool>The predicate to choose cells.
Returns
FirstColumnUsed(Func<IXLRangeColumn, bool>)
IXLRangeColumn FirstColumnUsed(Func<IXLRangeColumn, bool> predicate = null)
Parameters
predicateFunc<IXLRangeColumn, bool>
Returns
FirstRow(Func<IXLRangeRow, bool>)
Gets the first row of the range.
IXLRangeRow FirstRow(Func<IXLRangeRow, bool> predicate = null)
Parameters
predicateFunc<IXLRangeRow, bool>
Returns
FirstRowUsed(XLCellsUsedOptions, Func<IXLRangeRow, bool>)
Gets the first non-empty row of the range that contains a cell with a value.
IXLRangeRow FirstRowUsed(XLCellsUsedOptions options, Func<IXLRangeRow, bool> predicate = null)
Parameters
optionsXLCellsUsedOptionsThe options to determine whether a cell is used.
predicateFunc<IXLRangeRow, bool>The predicate to choose cells.
Returns
FirstRowUsed(Func<IXLRangeRow, bool>)
IXLRangeRow FirstRowUsed(Func<IXLRangeRow, bool> predicate = null)
Parameters
predicateFunc<IXLRangeRow, bool>
Returns
InsertColumnsAfter(int)
Inserts X number of columns to the right of this range.
All cells to the right of this range will be shifted X number of columns.
IXLRangeColumns InsertColumnsAfter(int numberOfColumns)
Parameters
numberOfColumnsintNumber of columns to insert.
Returns
InsertColumnsAfter(int, bool)
IXLRangeColumns InsertColumnsAfter(int numberOfColumns, bool expandRange)
Parameters
Returns
InsertColumnsBefore(int)
Inserts X number of columns to the left of this range.
This range and all cells to the right of this range will be shifted X number of columns.
IXLRangeColumns InsertColumnsBefore(int numberOfColumns)
Parameters
numberOfColumnsintNumber of columns to insert.
Returns
InsertColumnsBefore(int, bool)
IXLRangeColumns InsertColumnsBefore(int numberOfColumns, bool expandRange)
Parameters
Returns
InsertRowsAbove(int)
Inserts X number of rows on top of this range.
This range and all cells below this range will be shifted X number of rows.
IXLRangeRows InsertRowsAbove(int numberOfRows)
Parameters
numberOfRowsintNumber of rows to insert.
Returns
InsertRowsAbove(int, bool)
IXLRangeRows InsertRowsAbove(int numberOfRows, bool expandRange)
Parameters
Returns
InsertRowsBelow(int)
Inserts X number of rows below this range.
All cells below this range will be shifted X number of rows.
IXLRangeRows InsertRowsBelow(int numberOfRows)
Parameters
numberOfRowsintNumber of rows to insert.
Returns
InsertRowsBelow(int, bool)
IXLRangeRows InsertRowsBelow(int numberOfRows, bool expandRange)
Parameters
Returns
LastColumn(Func<IXLRangeColumn, bool>)
Gets the last column of the range.
IXLRangeColumn LastColumn(Func<IXLRangeColumn, bool> predicate = null)
Parameters
predicateFunc<IXLRangeColumn, bool>
Returns
LastColumnUsed(XLCellsUsedOptions, Func<IXLRangeColumn, bool>)
Gets the last non-empty column of the range that contains a cell with a value.
IXLRangeColumn LastColumnUsed(XLCellsUsedOptions options, Func<IXLRangeColumn, bool> predicate = null)
Parameters
optionsXLCellsUsedOptionsThe options to determine whether a cell is used.
predicateFunc<IXLRangeColumn, bool>The predicate to choose cells.
Returns
LastColumnUsed(Func<IXLRangeColumn, bool>)
IXLRangeColumn LastColumnUsed(Func<IXLRangeColumn, bool> predicate = null)
Parameters
predicateFunc<IXLRangeColumn, bool>
Returns
LastRow(Func<IXLRangeRow, bool>)
Gets the last row of the range.
IXLRangeRow LastRow(Func<IXLRangeRow, bool> predicate = null)
Parameters
predicateFunc<IXLRangeRow, bool>
Returns
LastRowUsed(XLCellsUsedOptions, Func<IXLRangeRow, bool>)
Gets the last non-empty row of the range that contains a cell with a value.
IXLRangeRow LastRowUsed(XLCellsUsedOptions options, Func<IXLRangeRow, bool> predicate = null)
Parameters
optionsXLCellsUsedOptionsThe options to determine whether a cell is used.
predicateFunc<IXLRangeRow, bool>The predicate to choose cells.
Returns
LastRowUsed(Func<IXLRangeRow, bool>)
IXLRangeRow LastRowUsed(Func<IXLRangeRow, bool> predicate = null)
Parameters
predicateFunc<IXLRangeRow, bool>
Returns
Range(IXLAddress, IXLAddress)
Returns the specified range.
IXLRange Range(IXLAddress firstCellAddress, IXLAddress lastCellAddress)
Parameters
firstCellAddressIXLAddressThe first cell address in the range.
lastCellAddressIXLAddressThe last cell address in the range.
Returns
Range(IXLCell, IXLCell)
Returns the specified range.
IXLRange Range(IXLCell firstCell, IXLCell lastCell)
Parameters
Returns
Range(IXLRangeAddress)
Returns the specified range.
IXLRange Range(IXLRangeAddress rangeAddress)
Parameters
rangeAddressIXLRangeAddressThe range boundaries.
Returns
Range(int, int, int, int)
Returns the specified range.
IXLRange Range(int firstCellRow, int firstCellColumn, int lastCellRow, int lastCellColumn)
Parameters
firstCellRowintThe first cell's row of the range to return.
firstCellColumnintThe first cell's column of the range to return.
lastCellRowintThe last cell's row of the range to return.
lastCellColumnintThe last cell's column of the range to return.
Returns
- IXLRange
.
Range(string)
Returns the specified range.
IXLRange Range(string rangeAddress)
Parameters
rangeAddressstringThe range boundaries.
Returns
Range(string, string)
Returns the specified range.
IXLRange Range(string firstCellAddress, string lastCellAddress)
Parameters
firstCellAddressstringThe first cell address in the range.
lastCellAddressstringThe last cell address in the range.
Returns
RangeUsed()
IXLRange RangeUsed()
Returns
Ranges(string)
Returns a collection of ranges, separated by commas.
IXLRanges Ranges(string ranges)
Parameters
rangesstringThe ranges to return.
Returns
Row(int)
Gets the specified row of the range.
IXLRangeRow Row(int row)
Parameters
rowint1-based row number relative to the first row of this range.
Returns
- IXLRangeRow
The relevant row
RowCount()
Gets the number of rows in this range.
int RowCount()
Returns
Rows(Func<IXLRangeRow, bool>)
IXLRangeRows Rows(Func<IXLRangeRow, bool> predicate = null)
Parameters
predicateFunc<IXLRangeRow, bool>
Returns
Rows(int, int)
Gets a collection of the specified rows in this range.
IXLRangeRows Rows(int firstRow, int lastRow)
Parameters
firstRowintThe first row to return. 1-based row number relative to the first row of this range.
lastRowintThe last row to return. 1-based row number relative to the first row of this range.
Returns
Rows(string)
Gets a collection of the specified rows in this range, separated by commas.
e.g. Rows("4:5"), Rows("7:8,10:11"), Rows("13")
IXLRangeRows Rows(string rows)
Parameters
rowsstringThe rows to return.
Returns
RowsUsed(XLCellsUsedOptions, Func<IXLRangeRow, bool>)
IXLRangeRows RowsUsed(XLCellsUsedOptions options, Func<IXLRangeRow, bool> predicate = null)
Parameters
optionsXLCellsUsedOptionspredicateFunc<IXLRangeRow, bool>
Returns
RowsUsed(Func<IXLRangeRow, bool>)
IXLRangeRows RowsUsed(Func<IXLRangeRow, bool> predicate = null)
Parameters
predicateFunc<IXLRangeRow, bool>
Returns
Sort()
IXLRange Sort()
Returns
Sort(int, XLSortOrder, bool, bool)
IXLRange Sort(int columnToSortBy, XLSortOrder sortOrder = XLSortOrder.Ascending, bool matchCase = false, bool ignoreBlanks = true)
Parameters
columnToSortByintsortOrderXLSortOrdermatchCaseboolignoreBlanksbool
Returns
Sort(string, XLSortOrder, bool, bool)
IXLRange Sort(string columnsToSortBy, XLSortOrder sortOrder = XLSortOrder.Ascending, bool matchCase = false, bool ignoreBlanks = true)
Parameters
columnsToSortBystringsortOrderXLSortOrdermatchCaseboolignoreBlanksbool
Returns
SortLeftToRight(XLSortOrder, bool, bool)
IXLRange SortLeftToRight(XLSortOrder sortOrder = XLSortOrder.Ascending, bool matchCase = false, bool ignoreBlanks = true)
Parameters
sortOrderXLSortOrdermatchCaseboolignoreBlanksbool
Returns
Transpose(XLTransposeOptions)
Transposes the contents and styles of all cells in this range.
void Transpose(XLTransposeOptions transposeOption)
Parameters
transposeOptionXLTransposeOptionsHow to handle the surrounding cells when transposing the range.