April 2006
Beginner
1114 pages
98h 16m
English
listrow.Range
Returns a reference to the Range object for a row in the list. Use the Range property to get the values and address of items in a list. For example, the following code creates a new row and sets the values of the second, third, and fourth items in the row:
Sub SetValues( )
Dim ws As Worksheet, lst As ListObject, row As ListRow
Set ws = ActiveSheet
Set lst = ws.ListObjects("Test List")
lst.ListRows.Add (2)
lst.ListRows(2).Range.Cells(1, 2).Value = "a"
lst.ListRows(2).Range.Cells(1, 3).Value = "b"
lst.ListRows(2).Range.Cells(1, 4).Value = "c"
lst.ListRows(2).Range.Cells(1, 5).Value = "d"
End SubRead now
Unlock full access