DeleteRowsOrColumns

Top  Previous  Next

Deletes the rows or columns indicated, even (unlike Excel's Delete command) if they intersect array constants, array formulas or data tables.

Applies to

IOAKAddIn, IOAKAPI

SYNTAX

result = expression1.DeleteRowsOrColumns

expression2.DeleteRowsOrColumns(Range)

expression1   Required.  An expression that returns an IOAKAddIn object.

expression2   Required.  An expression that returns an IOAKAPI object.

result   An OAKResult enumeration indicating the success or otherwise of the action.

Range           Required Range.  The range to be deleted.

Remarks

When applied to an IOAKAddIn object, the DeleteRowsOrColumns method performs the same action as the Home | Cells | Delete command.   It deletes the selected rows or columns, even if they intersect array constants, array formulas or data tables.  

When applied to an IOAKAPI object, the DeleteRowsOrColumns method deletes the rows or columns indicated by the parameter submitted to the method.  

Wrinkles

To specify what is to be inserted unambiguously, Range needs to be one or more entire rows or one or more entire columns.  It must consist of a single area only; a multi-area range will generate an error.

Though the Delete method can delete rows or columns that pass through array constants, array formulas or data tables, it cannot perform deletions that intersect pivot tables.

The Delete method will not work on worksheets that are protected.