Hello,
I have a listobject (MyTable) situated above a larger dataset (= more columns) on a worksheet. This MyTable gets cleared and its databodyrange removed by either a macro or a manual delete.
Normally in order to reset the databodyrange I would write:
However because there is a larger dataset below this table, VBA will return an error as it is unable to insert and shift the cells of the table downward without corrupting the larger dataset.
When deleting rows the same error will occure, however I can circumvent the error by deleting the entire row:
My problem is that when there is no databodyrange, I am unable to select the EntireRow!
In order to circumvent the databodyrange I have tried the following:
This does get me back a databodyrange, however instead of 1 single row, I now have 2 whereby one row has lost its formulas.
Is there a way to achieve the same as MyTable.ListRows.add (1) but then with an entire row and without losing formating and formulas?
Any help is greatly appreciated,
with kind regards Tackwise
I have a listobject (MyTable) situated above a larger dataset (= more columns) on a worksheet. This MyTable gets cleared and its databodyrange removed by either a macro or a manual delete.
Normally in order to reset the databodyrange I would write:
Code:
MyTable.ListRows.add (1)
When deleting rows the same error will occure, however I can circumvent the error by deleting the entire row:
Code:
MyTable.DataBodyRange.Rows(n).EntireRow.Delete
My problem is that when there is no databodyrange, I am unable to select the EntireRow!
In order to circumvent the databodyrange I have tried the following:
Code:
MySheet.Rows(MyTable.HeaderRowRange.Row + 1).EntireRow.Resize(1).Insert
This does get me back a databodyrange, however instead of 1 single row, I now have 2 whereby one row has lost its formulas.
Is there a way to achieve the same as MyTable.ListRows.add (1) but then with an entire row and without losing formating and formulas?
Any help is greatly appreciated,
with kind regards Tackwise