user736893
user736893

Reputation:

Add row to table/named range with specific values?

I'm simply trying to add a new row to a table and specify certain values. Right now, I am adding the row using the following code:

ActiveSheet.ListObjects("tableName").ListRows.Add

This works, but now how would I make the first column have the value foo?

ListRows.Add() only supports one parameter, an index at which it will add the row. Is there another function I can use?

Upvotes: 1

Views: 1215

Answers (1)

RADO
RADO

Reputation: 8148

Dim Your_Table As ListObject
Dim New_Row As ListRow

Set Your_Table =ActiveSheet.ListObjects("tableName")
Set New_Row = Your_Table.ListRows.Add

New_Row.Range(1) = foo

Upvotes: 1

Related Questions