Quantcast
Channel: Active questions tagged row - Stack Overflow
Viewing all articles
Browse latest Browse all 447

Excel-VBA-How to add new row to end of table and unlock new row?

$
0
0

The following works to add a new row to the end of the table and unlock that row. However, I keep getting "Run-Time Error 424: Object Required" despite completing the action.

Don't know why this is happening.

Sub AddRowToTable()Dim ws As WorksheetDim tbl As ListObjectDim lastRow As ListRowSet ws = ActiveSheetSet tbl = ws.ListObjects("Table1")tbl.ListRows.Add Set lastRow = tbl.Range.Rows(tbl.Range.Rows.Count).RowlastRow.Locked = FalseEnd Sub

Viewing all articles
Browse latest Browse all 447

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>