ListObject.InsertRowRange Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets a Range that represents the Insert row, if any, of the ListObject control.
public:
property Microsoft::Office::Interop::Excel::Range ^ InsertRowRange { Microsoft::Office::Interop::Excel::Range ^ get(); };
public Microsoft.Office.Interop.Excel.Range InsertRowRange { get; }
member this.InsertRowRange : Microsoft.Office.Interop.Excel.Range
Public ReadOnly Property InsertRowRange As Range
Property Value
A Range that represents the Insert row, if any, of the ListObject control.
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 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.");
}
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
Remarks
If there is no Insert row, InsertRowRange returns null
.