Hi all,
I'm having great difficulty and I'm hoping the Brains Trust can help me.
The task I'm trying to achieve, copy data from a 'new' spreadsheet (about 28 columns and 2.5k rows), then open up an 'existing' spreadsheet and paste the data, sounds simple right? Both workbooks have identical headers, so only the amount of rows may change. If the 'existing' workbook has more rows than the 'new' one, delete the 'existing' table of all rows (excluding headers), then paste the 'new' data in its place.
The problems I am hitting:
- If I use the delete rows function from cell A2 (leaving the header row) to FirstFreeRow it deletes all the rows, including the header and the table is no longer a table.
- If I use the Paste cells function from A2 to FirstFreeRow it works fine, but if existing worksheet had 50 more rows than the data that was pasted, then there are 50 additional rows of data (which will cause duplicates and corrupt the end results).
- If I try and be dodgy and tell it to paste an additional 100 rows to blank out potential additional data, it doesn't do it.
- If I use variables to define FirstFreeRow of the 'new' and the 'existing' and then tell it to delete cells starting from 'new' FirstFreeRow to 'existing' FirstFreeRow, for some reason it deletes all the rows, including the header and the table is no longer a table.
Essentially anything I try with Delete Cells is clearing all the data, including headers and removing the table.
I'm open to other ways to figure this out, so any suggestions you may have would be greatly appreciated.