ListObject.ListRows property (Excel)
Returns a ListRows object that represents all the rows of data in the ListObject object. Read-only.
Syntax
expression.ListRows
expression A variable that represents a ListObject object.
Remarks
The ListRows object returned does not include the header, total, or Insert rows.
Example
The following example deletes a row specified by number in the ListRows collection that is created by a call to the ListRows property.
Sub DeleteListRow(iRowNumber As Integer)
Dim wrksht As Worksheet
Dim objListObj As ListObject
Dim objListRows As ListRows
Set wrksht = ActiveWorkbook.Worksheets("Sheet1")
Set objListObj = wrksht.ListObjects(1)
Set objListRows = objListObj.ListRows
If (iRowNumber <> 0) And (iRowNumber < objListRows.Count - 1) Then
objListRows(iRowNumber).Delete
End If
End Sub
Support and feedback
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.