Captain Smith
Active Member
- Joined
- Feb 28, 2003
- Messages
- 324
I want to delete the cell on the next row if it is the same value as the active cell.
The following works, but is very slow considering that it is working on only 32 cells.
Is there a way to rewrite this to go faster? Thanks.
Sub speeditup()
Dim cell As Range
Application.ScreenUpdating = False
For Each cell In Range("Q8:Q40")
If cell = cell.Offset(1, 0) Then
cell.Delete Shift:=xlUp
End If
Next
Application.ScreenUpdating = True
End Sub
The following works, but is very slow considering that it is working on only 32 cells.
Is there a way to rewrite this to go faster? Thanks.
Sub speeditup()
Dim cell As Range
Application.ScreenUpdating = False
For Each cell In Range("Q8:Q40")
If cell = cell.Offset(1, 0) Then
cell.Delete Shift:=xlUp
End If
Next
Application.ScreenUpdating = True
End Sub