CopyRange Method
Applies To
fpSpread control
Description
Copies the data, formatting, formulas, and notes from a block of cells to a new location.
Syntax
void CSpreadSheet::CopyRange(long lCol, long lRow, long lCol2, long lRow2, long lColDest, long lRowDest);
fpSpread1.CopyRange(ByVal lCol As Long, ByVal lRow As Long, ByVal lCol2 As Long, ByVal lRow2 As Long, ByVal lColDest As Long, ByVal lRowDest As Long)
Parameters
The following parameters are available:
Parameter | Description |
---|---|
lCol | Column number of top-left cell in block to copy |
lRow | Row number of top-left cell in block to copy |
lCol2 | Column number of bottom-right cell in block to copy |
lRow2 | Row number of bottom-right cell in block to copy |
lColDest | Destination column for upper-left cell in block |
lRowDest | Destination row for upper-left cell in block |
Remarks
The CopyRange method copies the data and formatting in a block of cells.
The destination column and row indicate the upper-left cell of the destination block. The contents of the destination block cells are replaced by the copied cells' contents. Destination cells that overlap the original block of cells are handled as described in Copying Data.
Caution: Copying a range of cells pastes them over existing cells. You might want to caution users and have them verify a copy command before overwriting their existing data. |
This method is called for the current sheet setting unless you first set the Sheet property to specify the sheet with which you want to work.
Cell-related information (for example, text, font, background color, text color, and cell type) is stored in one of four locations.
When applied to a block of cells, the CopyRange method works with only the information in the cell itself. If you set the Col or Row parameter to –1 to write data, no information is stored in the cell itself and the CopyRange method is ignored. For more information, see Precedence of Settings.
Return Type
None
See Also
Sheet property
ClearRange, CopyColRange, CopyRowRange, MoveRange, SwapRange methods
DLL Correspondence
SSCopyRange function