Deletes the current selection from a worksheet.Deletes the current selection from a worksheet.
BOOL DeleteSelection( BOOL bUndo )
- [input] Whether to support Undo (TRUE) or not (FALSE)
FALSE if there is no selection, otherwise TRUE
// This example shows how to programmatically setup a
// selection of alternate rows and delete those alternate
// rows in the active worksheet.
void del_alternate_rows(BOOL nUndo = 1)
Worksheet wks = Project.ActiveLayer();
int nRows = wks.GetNumRows();
// generate array of row index to delete
// alternate rows, so (0-offset) 1,3,5,7,..
if(nRows > 0)
nvAlternateRows.Data(1, nRows-1, 2);
wks.SetSelectedRange( nvAlternateRows );
wks.DeleteSelection( nUndo );
printf("empty worksheet, not enough rows to delete");
Deletes the current selection from a worksheet.
If the selection is in the data area, rows below the selection move up.
If the selection is in the label area, cell contents are cleared.
This command handles regions (multiple selection ranges)
WARNING! The range's data also be deleted.
header to Include