View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
[email protected] paul.robinson@it-tallaght.ie is offline
external usenet poster
 
Posts: 789
Default How can I make this Loop faster, screen updating is off

Hi
Don't know about faster, but you should use

For r = Lastrow to 2 step -1

as you are deleting rows. This would throw off your loop cycling
forwards.
To speed things up don't use a loop. Filter the range for the word
"closed" then copy the whole filtered range to the new sheet in one
go. Then delete the filtered range. Try using the macro recorder while
doing this to see the code.

regards
Paul

On Dec 12, 10:42*am, wrote:
LastRow = Range("F" & Rows.Count).End(xlUp).Row

For r = 2 To LastRow Step 1 ' Headings in row 1
* * If Cells(r, "F").Value = "Closed" Then
* * * * Rows(r).Copy Destination:=Sheets _
* * * * * * ("Interim").Range("A2").Offset(off, 0)
* * * * Rows(r).Delete
* * * * off = off + 1
* * End If
Next

Thanks