Udostępnij za pośrednictwem


ListObject.InsertRowRange Property (2007 System)

Gets a Range that represents the Insert row, if any, of the ListObject control.

Namespace:  Microsoft.Office.Tools.Excel
Assembly:  Microsoft.Office.Tools.Excel.v9.0 (in Microsoft.Office.Tools.Excel.v9.0.dll)

Syntax

'Declaration
<BrowsableAttribute(False)> _
Public ReadOnly Property InsertRowRange As Range
'Usage
Dim instance As ListObject 
Dim value As Range 

value = instance.InsertRowRange
[BrowsableAttribute(false)]
public Range InsertRowRange { get; }
[BrowsableAttribute(false)]
public:
property Range^ InsertRowRange {
    Range^ get ();
}
public function get InsertRowRange () : Range

Property Value

Type: Range
A Range that represents the Insert row, if any, of the ListObject control.

Remarks

If there is no Insert row, InsertRowRange returns nulla null reference (Nothing in Visual Basic).

Examples

The following code example creates a ListObject, gets the range that contains the Insert row, and then displays a message showing how many cells the Insert row contains.

This example is for a document-level customization.

Private Sub ListObject_InsertRowRange()
    Dim List1 As Microsoft.Office.Tools.Excel.ListObject = _
        Me.Controls.AddListObject(Me.Range("A1", "C4"), "List1")

    Dim insertRow As Excel.Range = List1.InsertRowRange
    MessageBox.Show("The insert row contains " & _
        insertRow.Cells.Count.ToString() & " cells.")
End Sub
private void ListObject_InsertRowRange()
{
    Microsoft.Office.Tools.Excel.ListObject list1 =
        this.Controls.AddListObject(
        this.Range["A1", "C4"], "list1");

    Excel.Range insertRow = list1.InsertRowRange;
    MessageBox.Show("The insert row contains " + 
        insertRow.Cells.Count.ToString() +
        " cells.");
}

.NET Framework Security

See Also

Reference

ListObject Class

ListObject Members

Microsoft.Office.Tools.Excel Namespace