Share via


Range.Insert Method

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

Namespace:  Microsoft.Office.Interop.Excel
Assembly:  Microsoft.Office.Interop.Excel (in Microsoft.Office.Interop.Excel.dll)

Syntax

'Declaration
Function Insert ( _
    Shift As Object, _
    CopyOrigin As Object _
) As Object
'Usage
Dim instance As Range
Dim Shift As Object
Dim CopyOrigin As Object
Dim returnValue As Object

returnValue = instance.Insert(Shift, CopyOrigin)
Object Insert(
    Object Shift,
    Object CopyOrigin
)

Parameters

  • Shift
    Type: System.Object

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

  • CopyOrigin
    Type: System.Object

    Optional Object. The copy origin.

Return Value

Type: System.Object

See Also

Reference

Range Interface

Range Members

Microsoft.Office.Interop.Excel Namespace