InsertRowRange Property

Microsoft Excel Visual Basic

Show All Show All

InsertRowRange Property

Returns a Range object representing the Insert row, if any, of a specified ListObject object. Read-only Range.

expression.InsertRowRange

expression    Required. An expression that returns a ListObject object.

Remarks

If the Insert row is not visible because the list is inactive, the Nothing object will be returned.

Example

The following example activates the range specified by the InsertRowRange in the default ListObject object in the first worksheet of the active workbook.

    Function ActivateInsertRow() As Boolean
   
    Dim wrksht As Worksheet
    Dim objList As ListObject
    Dim objListRng As Range
   
    Set wrksht = ActiveWorkbook.Worksheets(1)
    Set objList = wrksht.ListObjects(1)
    Set objListRng = objList.InsertRowRange

    If objListRng Is Nothing Then
        ActivateInsertRow = False
    Else
        objListRng.Activate
        ActivateInsertRow = True
    End If

End Function