I have a spreadsheet that is 50K+ lines. I need to copy each row and paste the data into a new sheet based on the value of a specific cell in that row. There are potentially 20-25 different values for the cells that I am checking. Therefore I need to create 20-25 new worksheets and sort the data into them.
I am using this code but I am sure there is a more elegant(aka faster) way of doing this sort.
Any assistance would be appreciated. Thank you
I am using this code but I am sure there is a more elegant(aka faster) way of doing this sort.
VBA Code:
irow=ws.cells(row.count,2).end(xlup).row+1
For X=2 to irow
set ws2=worksheets(ws.cells(x,19).value)
irow2=ws2.cells(rows.count,2).end(xlup).row+1
ws.range(x & ":" & x).copy
ws2.range(irow2 & ":" & irow2).pastespecial xlpastevalues
next x
Any assistance would be appreciated. Thank you