On one sheet I have data from column A to column L.
I have a macro that, given user input, searches the rows, and then copy and pastes that row into a different (initally blank) sheet. The search will then continue, each time copying and pasting.
Sometimes this involves copying & pasting 500 rows. Excel starts struggling at around 400 rows, is very slow and often crashes.
I have read Slow VBA macro writing in cells but I am not sure if it applies.
Would creating a collection of the row numbers resulting from my search and then looping through and copying & pasting the corresponding row be any quicker than copying and pasting the row as soon as it has been 'found' (this is how it currently works)?
Can I speed up this process of copying & pasting a large amount of rows?
nextblankrow=worksheets("findings").Range("A"&rows.count).End(xlup).row+1
Sheets("data").cells(J,1).EntireRow.copy sheets("findings").cells(nextblankrow,1)
In the above code, the first line finds the next empty row in the "findings" sheet.
Then the second line copies the row in the "data" sheet which has been found to match the user input into the "findings" sheet.
After this, it goes back to the search until it has got to the end of data in the "data" sheet. But I have determined that it is the copying that is causing slowness and crashing.