I know VBA in Excel isn't the quickest of things - but I need the most efficient (i.e. quickest) way to loop through a large sample of rows.
Currently I have:
For Each c In Range("$A$2:$A$" & Cells(Rows.count, "A").End(xlUp).row
' do stuff
Next c
The 'do stuff' includes insert a row here and there (so I need to keep the dynamic lookup of the range.)
Any ideas (looking at 10,000 rows+)?
EDIT
I am already using
Application.ScreenUpdating = False
Application.Calculation = xlManual
解决方案
If you are just looping through 10k rows in column A, then dump the row into a variant array and then loop through that.
You can then either add the elements to a new array (while adding rows when needed) and using Transpose() to put the array onto your range in one