Insert method (Excel Graph)
Inserts a cell or a range of cells into the datasheet and shifts other cells away to make space.
expression.Insert (Shift)
expression Required. An expression that returns one of the objects in the Applies To list.
Name | Required/Optional | Data type | Description |
---|---|---|---|
Shift | Optional | XlInsertShiftDirection | Specifies which way to shift the cells. Can be one of these XlInsertShiftDirection constants: xlShiftToRight or xlShiftDown. If this argument is omitted, Graph decides based on the shape of the range. |
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
Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.