ITabRange.Delete

Syntax

Delete(Value: TabDeleteShiftDirection);

Parameters

Value. Method of deleting cell range.

Description

The Delete method deletes the set cell range.

Comments

To insert the required cell range, use the ITabRange.Insert method.

Example

Executing the example requires that the repository contains a regular report with the REGULAR_REPORT_ITABSHEET_INSERT_DELETE identifier. The regular report must contain the cell range A0:I12 filled with any values.

Executing the example requires to add links to the Metabase, Report, Tab system assemblies.

Sub userproc;
Var
    mb: IMetaBase;
    regrep: IPrxReport;
    sheet: IPrxSheet;
    table: IPrxTable;
    range: ITabSheet;
    diap1: ITabRange;
    diap2: ITabRange;
Begin
    // Open a regular report for edit
    mb := MetabaseClass.Active;
    regrep := mb.ItemById("REGULAR_REPORT_ITABSHEET_INSERT_DELETE").Edit As IPrxReport;
    // Get cell range (A11:I11)
    sheet := regrep.Activesheet;
    table := sheet As IPrxTable;
    range := table.TabSheet;
    diap1 := range.ParseRange("A11:I11");
    // Delete the cell range with the offset of cells up
    diap1.Delete(TabDeleteShiftDirection.ShiftUp);
    // Insert the cell range into the set range with the offset of cells to the right
    diap2 := range.ParseRange("A4:B4");
    diap2.Insert(TabInsertShiftDirection.ShiftToRight);
    // Save changes
    (regrep As IMetabaseObject).Save;
End Sub userproc;

After executing the example the cell range A12:A11 is offset by one row up, and the range A5:I5 is offset by two cells to the right.

See also:

ITabRange