philfer
Technical User
- Jan 18, 2008
- 11
Hi,
I have a worksheet in a workbook with lots of ledger codes. I want to loop down column A and when it finds a particular code saya 2010 I want to copy the entire row into another worksheet so that the new worksheet only has the details for this ledger code 2010.
I am using a loop (For i = 1 to lastrow) and then doing
Activesheet.Cells(i,1).EntireRow Copy Sheet("Sheet2").Range(j,1)
(j is obtained by finding the lastrow on the new sheet then adding 1 each time 2010 is found)
but it is SLOOOOOOOW.
It takes forever (well about a minute but in macro time it seems like forever)
Is there a quick way of doing this
I have a worksheet in a workbook with lots of ledger codes. I want to loop down column A and when it finds a particular code saya 2010 I want to copy the entire row into another worksheet so that the new worksheet only has the details for this ledger code 2010.
I am using a loop (For i = 1 to lastrow) and then doing
Activesheet.Cells(i,1).EntireRow Copy Sheet("Sheet2").Range(j,1)
(j is obtained by finding the lastrow on the new sheet then adding 1 each time 2010 is found)
but it is SLOOOOOOOW.
It takes forever (well about a minute but in macro time it seems like forever)
Is there a quick way of doing this