View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Excel 2002 - Slow macros

Sub Delete_Row_600_551()
Dim res as Long
Dim i as Long
Sheets("Data").Select
res = Application.Calculation
application.Calculation = xlManual
Application.ScreenUpdating = False
for i = 600 to 551 step -1
If Cells(i,"G").Value< Range("Q1") or _
Cells(i,"G").Vaue Range("S1") Then
cells(i,"G").EntireRow.Delete
End if
Next i
Application.Calculation = res
Application.ScreenUpdating = True
End Sub

--
Regards,
Tom Ogilvy


wrote in message
...
Here is a small Example

Sub Delete_Row_600_551()

Sheets("Data").Select

If Range("G600") < Range("Q1") Then
Rows("600:600").Select
Selection.Delete Shift:=xlUp
End If

If Range("G600") Range("S1") Then
Rows("600:600").Select
Selection.Delete Shift:=xlUp
End If


If Range("G599") < Range("Q1") Then
Rows("599:599").Select
Selection.Delete Shift:=xlUp
End If

If Range("G599") Range("S1") Then
Rows("599:599").Select
Selection.Delete Shift:=xlUp
End If
End Sub


-----Original Message-----
Can you post your script here? Otherwise I cannot tell

you why it does
that....


---
Message posted from http://www.ExcelForum.com/

.