MrVBAConfused
New Member
- Joined
- Jul 29, 2021
- Messages
- 10
- Office Version
- 365
- Platform
- Windows
Hi all,
Please help!
I have inherited a spreadsheet with some macros already created and i want to amend one to help with some other functions:
I would like to add a complete worksheet row but at the bottom of the table:
So the current macro adds a line at the bottom of a table (so far so good)
Code is:
Dim tbl As ListObject
Dim lastRow1 As Long
Set tbl = ActiveSheet.ListObjects("XYZ")
tbl.ListRows.Add
lastRow1 = 1
However, this only inserts a row in the table not the complete row.
I have know the code to insert a full row:
Code is:
ActiveCell.EntireRow.Insert
But, this requires a cell/ range to be chosen or specified. unfortunately my table is dynamic and constantly changing.
there must be some way to select the table, then select the last row then just insert entire row. (this is probably way too easy for you guys! sorry!!)
Cheers
Martin
Please help!
I have inherited a spreadsheet with some macros already created and i want to amend one to help with some other functions:
I would like to add a complete worksheet row but at the bottom of the table:
So the current macro adds a line at the bottom of a table (so far so good)
Code is:
Dim tbl As ListObject
Dim lastRow1 As Long
Set tbl = ActiveSheet.ListObjects("XYZ")
tbl.ListRows.Add
lastRow1 = 1
However, this only inserts a row in the table not the complete row.
I have know the code to insert a full row:
Code is:
ActiveCell.EntireRow.Insert
But, this requires a cell/ range to be chosen or specified. unfortunately my table is dynamic and constantly changing.
there must be some way to select the table, then select the last row then just insert entire row. (this is probably way too easy for you guys! sorry!!)
Cheers
Martin