Jared_Jones_23
New Member
- Joined
- Jun 24, 2011
- Messages
- 34
Hello I have a macro that opens another workbook and deletes rows based on specified criteria. The code that deletes the rows works fine but runs extremely slow. When I step through it my self it seems to work relatively quick but it gets caught up when its running. Here is the sub program that does the deleting. Any suggestions are appreciated thank you.
Jared
Sub delbrows2(fr, cse, delcnt)
Dim r As Integer
Application.ScreenUpdating = False
For r = Cells(rows.Count, 13).End(xlUp).End(xlUp).Row To fr Step -1 'For r = 1000 To 1 Step -1
If Cells(r, 13) <> cse Then
rows(r).Delete
'delcnt = delcnt + 1
End If
Next r
Application.ScreenUpdating = True
End Sub
Jared
Sub delbrows2(fr, cse, delcnt)
Dim r As Integer
Application.ScreenUpdating = False
For r = Cells(rows.Count, 13).End(xlUp).End(xlUp).Row To fr Step -1 'For r = 1000 To 1 Step -1
If Cells(r, 13) <> cse Then
rows(r).Delete
'delcnt = delcnt + 1
End If
Next r
Application.ScreenUpdating = True
End Sub