Insert Method

Applies To

Range object.

Description

Inserts a cell or a range of cells into the datasheet and shifts other cells away to make space.

Syntax

expression.Insert(Shift)

expression Required. An expression that returns a Range object.

Shift Optional Variant. Specifies which way to shift the cells. Can be one of the following XlInsertShiftDirection constants: xlShiftToRight or xlShiftDown. If this argument is omitted, Microsoft Graph decides based on the shape of the range.

Example

This example inserts a new row before row four on the datasheet.

myChart.Application.DataSheet.Rows(4).Insert
This example inserts new cells at the range A1:C5 on the datasheet and shifts cells downward.

Set mySheet = myChart.Application.DataSheet
mySheet.Range("A1:C5").Insert Shift:=xlShiftDown