PreviousNext
Help > Programming with LAUNCHER Office > LNCCMD commands > Commands list > XLINSERT command
XLINSERT command

 Inserts a cell , a range of cells, a row, a column into the worksheet and shifts other cells away.

 

Syntax

 

CHGVAR

VAR(&CMD) VALUE('XLINSERT')

CHGVAR

VAR(&PARM1) VALUE('
[Ref="Cell coordinates"]
[;Sheet="Sheet name"]
[;Row=Row number or displacement]
[;Col=Column number or displacement]
[;Shift=xlShiftDown/xlShifToRight]
[;Count=number]
[;EntireRow=True/False]
[;EntireColumn=True/False]
[;After=True/False]
[;Fill=True/False

')

CHGVAR

VAR(&PARM2) VALUE(' ')

CALL

PGM(LNCCMD) PARM(&HANDLE &CMD &OPT &PARM1 + &PARM2 &RESULT)

 

Parameters

Parameters

 

Parm1


Ref
: The reference to the cell can be given in the form:

- Syntax $B$3. Example: $B$3 denotes column B, row 3.

- Syntax CL. C to designate the column and L to designate the row. Example: B3 designates row 3, and column 2 (B).

- Symbolic name given to a cell or group of cells.

- "." will designate the active cell.

Sheet: Specifies the name of the sheet to be addressed.
If a cell name is indicated by Ref, then the Sheet keyword is not useful.
Otherwise, if the Sheet keyword is missing, the active sheet is addressed.

Row, Col: These two keywords represent respectively:
- The coordinates (Line, Column) of a cell, if Ref is absent.
- The relative coordinates in rows and columns from the base referenced by "Ref =" when it is present. The upper left cell has relative coordinates (1,1).

Shift= xlShiftToRight to shift the actual cells to the right, or xlShiftDown (default) pour shift the cells down.

 

Count=Number of insertions to proceed.

 

EntireRow=True to insert entire rows, or False (default) to move  cells down the width of the selection.
This keyword is valid only if Shift= xlShiftDown.

 

EntireColumn= True to insert entire columns, or False (default) to shift cells to the right, over the height of the selection.
This keyword is valid only if Shift= xlShiftToRight.

 

After=True to insert after the selection, False (default) to insert before the selection.

 

Fill=True to copy the selection to the set of new inserted cells., False (default) to keep the new cells emptys.
When Fill is true, After must also be true.

 

 

Examples

The following example inserts 1 entire row, at the current active cell position.

 

CHGVAR

VAR(&CMD) VALUE('XLINSERT')

CHGVAR

VAR(&PARM1) VALUE('EntireRow=True')

CHGVAR

VAR(&PARM2) VALUE(' ')

CALL

PGM(LNCCMD) PARM(&HANDLE &CMD &OPT &PARM1 +

&PARM2 &RESULT)

 

Insert 10 entire rows, after the 5th row ; Copy the 5th row over the 10 new rows.

 

CHGVAR

VAR(&CMD) VALUE('XLINSERT')

CHGVAR

VAR(&PARM1) +
VALUE('Selection="$A$5";Count=10;EntireRow=True; +
After=true;Fill=True')

CHGVAR

VAR(&PARM2) VALUE(' ')

CALL

PGM(LNCCMD) PARM(&HANDLE &CMD &OPT &PARM1 +

&PARM2 &RESULT)

 

See also

XLCELLS