2.2.4.46.12 Worksheet::DeleteRange

Description

Delete a range of data in the worksheet

Syntax

BOOL DeleteRange( int nRowBegin, int nColBegin, int nRowEnd, int nColEnd, BOOL bInsertNotDelete = false, BOOL bUndo = false )

Parameters

nRowBegin
[input] Beginning row number (zero offset)
nColBegin
[input] Beginning column number (zero offset)
nRowEnd
[input] Ending row number (zero offset)
nColEnd
[input] Ending column number (zero offset)
bInsertNotDelete
[input] if TRUE then insert rows, False by default.
bUndo
[input] Whether to support Undo (TRUE) or not (FALSE)

Return

TRUE for success, otherwise FALSE

Examples

EX1

// Delete a range from a worksheet - rows after last deleted row move up in the worksheet
int Worksheet_DeleteRange_Ex1()
{
    WorksheetPage wp = Project.WorksheetPages(0);
    if(!wp)
        return -1;
    
    Worksheet wks(wp.GetName());
    return (int)wks.DeleteRange(0,0,4,1); // Delete five rows of first two columns
}

Remark

Delete a range of data in the worksheet.

WARNING! range's data also be deleted.

See Also

Worksheet::DeleteCol

Header to Include

origin.h