Hi Experts
I have some code as follows:
With tblDest
On Error Resume Next
.DataBodyRange.Delete
.Resize .Range.Resize(tblSource.ListRows.Count + 1, .ListColumns.Count)
On Error GoTo 0
End With
The number of data rows in tblSource = 3 so I would expect when I resize tblDest I would expect the number of rows in that table to be 4 but it is only resizing to 1. I have checked the values by using
MsgbBox tblSource.ListRows.Count + 1 (this gives 4)
MsgbBox tblDest.ListRows.Count (this gives 1)
I use the code .DataBodyRange.Delete as I want to retain the formulas and formatting in tblDest. I assume the issue is around using the .DataBodyRange.Delete but cannot work out how to get around it.
Any help is greatly appreciated.
Jack
I have some code as follows:
With tblDest
On Error Resume Next
.DataBodyRange.Delete
.Resize .Range.Resize(tblSource.ListRows.Count + 1, .ListColumns.Count)
On Error GoTo 0
End With
The number of data rows in tblSource = 3 so I would expect when I resize tblDest I would expect the number of rows in that table to be 4 but it is only resizing to 1. I have checked the values by using
MsgbBox tblSource.ListRows.Count + 1 (this gives 4)
MsgbBox tblDest.ListRows.Count (this gives 1)
I use the code .DataBodyRange.Delete as I want to retain the formulas and formatting in tblDest. I assume the issue is around using the .DataBodyRange.Delete but cannot work out how to get around it.
Any help is greatly appreciated.
Jack