SwapRange Method
Applies To
fpSpread control
Description
Swaps the data and formatting in a block of cells with another block of cells in the sheet.
Syntax
void CSpreadSheet::SwapRange(long lCol, long lRow, long lCol2, long lRow2, long lColDest, long lRowDest);
fpSpread1.SwapRange(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 swap |
lRow | Row number of top-left cell in block to swap |
lCol2 | Column number of bottom-right cell in block to swap |
lRow2 | Row number of bottom-right cell in block to swap |
lColDest | Destination column for upper-left cell in block |
lRowDest | Destination row for upper-left cell in block |
Remarks
The destination column and row indicate the upper-left cell of the destination block. The contents of the destination block cells are swapped with the original block of cells' contents. Destination cells that overlap the original block of cells are handled as described in Swapping 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 SwapRange 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 SwapRange method is ignored. For more information, see Precedence of Settings.
Return Type
None
See Also
Sheet property
ClearRange, CopyRange, MoveRange, SwapColRange, SwapRowRange methods
DLL Correspondence
SSSwapRange function