Insert Method

Microsoft Graph Visual Basic

Insert Method


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


expression   Required. An expression that returns one of the objects in the Applies To list.

Shift   Optional XlInsertShiftDirection.  Specifies which way to shift the cells.

XlInsertShiftDirection can be one of these XlInsertShiftDirection constants.

If this argument is omitted, Microsoft Graph decides based on the shape of the range.


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


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