Spread 8.0 Documentation
MoveRange Method
Support Options
ActiveX Reference > ActiveX Methods > MoveRange Method

Glossary Item Box

MoveRange Method


See Also    DLL    Example

Applies To

fpSpread control

Description

Moves a block of cells to a new location.

Syntax

C++

void CSpreadSheet::MoveRange(long lCol, long lRow, long lCol2, long lRow2, long lColDest, long lRowDest);

Visual Basic

fpSpread1.MoveRange(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
Col Column number of top-left cell in block to move
Row Row number of top-left cell in block to move
Col2 Column number of bottom-right cell in block to move
Row2 Row number of bottom-right cell in block to move
ColDest Destination column for upper-left cell in block
RowDest Destination row for upper-left cell in block

Remarks

The MoveRange method moves the data and formatting of the range 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 moved cells' contents. Destination cells that overlap the original block of cells are handled as described in Moving Data.

Caution: Moving a range of cells pastes them over existing cells. You might want to caution users and have them verify a move 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 MoveRange 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 MoveRange method is ignored. For more information, see Precedence of Settings.

Return Type

None

See Also

Moving Data Using Code

Sheet property

ClearRange, CopyRange, MoveColRange, MoveRowRange, SwapRange methods

DLL Correspondence

SSMoveRange function

© 2002-2014 ComponentOne, a division of GrapeCity. All Rights Reserved.