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

This command inserts or deletes rows and columns, to give a new size to an area of an Excel sheet. 

 

Syntax

 

CHGVAR

VAR(&CMD) VALUE('XLRESIZE')

CHGVAR

VAR(&PARM1) VALUE('
[Ref="Référence de cellules"]
[;RowCount=number]
[;ColCount=number]

[;Rowcnt=number]

[;Colcnt=number]
[;EntireRow=True/False]
[;EntireColumn=True/False]
[;Clear=True/False]
[;Fill=True/False]

[;Name="Nouveau nom de zone"]

')

CHGVAR

VAR(&PARM2) VALUE(' ')

CALL

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

 

Parameters

Parameters

 

Parm1


Ref: The reference of the area to resize.

1) Either we specify the name of the zone.

2) Either we specify the reference of the cell at the top left of the area to resize.
The cell reference at the top left can be given as:
- Syntax $B$3. Example: $B$3 is column B, line 3.
- Syntax CL. C to designate the column and L to designate the line. Example: B3 designates line 3, and column 2 (B).
- Symbolic name.
- "." to designate the active cell.

In this case we can use Rowcnt and Colcnt to specify the reference of the cell at the bottom right of the area to resize.

RowCnt, ColCnt: Rowcnt and Colcnt are used to specify the cell reference at the bottom right of the area to be resized, if the reference of the cell in the top left of the area to be resized has been specified with the Ref parameter. In this case, Rowcnt and Colcnt respectively represent the number of rows and columns selected, from the reference given by Ref.

RowCount: Number of rows in the resized zone.
If RowCount is absent, the number of rows in the field is not changed.

ColCount: Number of columns in the resized zone.
If ColCount is absent, the number of columns in the zone is not changed.

EntireRow : True to insert or delete whole lines, or False to move cells up or down the width of the selection.

EntireColumn : True to insert or delete entire columns, or False (default) to shift cells to the left or right over the height of the selection.

Fill : True to copy the selection to all new inserted cells.
False (default) to leave the new cells empty.
This option allows you to copy the calculation formulas into the new inserted rows or columns.

Clear : True clears all cells that do not contain formulas in the new zone.

Name allows you to assign a name to the resized area. If Ref refers to a named zone, the same name can be given to Name.

 

 

Examples

The following example resizes the area named "Orders" to 10 lines.
The number of columns in the zone does not change.
Entire lines are deleted or added. 

CHGVAR

VAR(&CMD) VALUE('XLRESIZE')

CHGVAR

VAR(&PARM1) VALUE('Ref="Orders";RowCount=10;EntireRow=True')

CHGVAR

VAR(&PARM2) VALUE(' ')

CALL

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

&PARM2 &RESULT)

 

The area named "Orders" is resized to 10 lines.
The formulas are copied to the new lines.
Cells not containing formulas are erased.
Insertions or deletions are done only over the width of the area. 

CHGVAR

VAR(&CMD) VALUE('XLRESIZE')

CHGVAR

VAR(&PARM1) +
VALUE('Ref="Orders";RowCount=10; +
Fill=True;Clear=True')

CHGVAR

VAR(&PARM2) VALUE(' ')

CALL

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

&PARM2 &RESULT)

 

The following area :

 

is resized with 10 lines, and named "Data":

 

LNCCMD CMD(XLRESIZE) + PARM1('Ref="$A$1";RowCount=10;name="Data";Fill=false;Rowcnt=3;Colcnt=3')

 

See also

         XLCELLS