[]
Copies the data, formatting, formulas, and notes from a block of cells on the sheet to a new location.
public void CopyRange(int fromRow, int fromColumn, int toRow, int toColumn, int rowCount, int columnCount, bool dataOnly)
Public Sub CopyRange(fromRow As Integer, fromColumn As Integer, toRow As Integer, toColumn As Integer, rowCount As Integer, columnCount As Integer, dataOnly As Boolean)
Type | Name | Description |
---|---|---|
int | fromRow | Row index of top-left cell in block to copy |
int | fromColumn | Column index of top-left cell in block to copy |
int | toRow | Row index of top-left cell in destination |
int | toColumn | Column index of top-left cell in destination |
int | rowCount | Number of rows in the block |
int | columnCount | Number of columns in the block |
bool | dataOnly | Whether only the data is copied, or the data and formatting |
Type | Condition |
---|---|
InvalidOperationException | Operation is not valid; cannot copy entire sheet of cells |
InvalidOperationException | Operation is not valid; cannot copy entire columns over partial columns |
InvalidOperationException | Operation is not valid; cannot copy entire rows over partial rows |
InvalidOperationException | Operation is not valid; cannot copy a range of cells over part of a spanned cell |