Thanks very much for your both replies.
Maybe I'm missing something, but one problem with '.Resize' that I found is that it doesn't add new rows into a table if the resize area is within the table area.
What I mean is this: Assuming I have a 2x2 table that like in column A and B, and it has 5 rows. If I run the following sub, I would expect the range 'a3:b3' to be resized into a twice as big range, or in other words extended, and therefore make the table to have 6 rows.
To me what '.resize' seems to do is overlap the below adjacent rows.
But yes, if the resize size is bigger than the table size than new rows and/or columns will be added into the table.
Back to my original task. I'm reading in large chunks of data and I need to append that data somewhere into within another table, the way I do it is shown in the following code and would like some opinions on it because I found a few drawbacks using this method:
The drawbacks:
- This doesn't work if the 'initialDataRow' (the row below which we want to add more data) is the last row. I worked around it by writing a special clause which peforms '.listrow.add' first and then do the rest.
- The way I add empty rows by doing '.Range.EntireRow.Insert' inserts new rows across the whole spreadsheet which might not be desirable in most cases when there are other things in the same sheet. Is there a way to add multiple rows into a table in one go that only affects that table?
I've added a working sample with the above two subs.
Many thanks for your help
Bookmarks