Stephen_IV
Well-known Member
- Joined
- Mar 17, 2003
- Messages
- 1,177
- Office Version
- 365
- 2019
- Platform
- Windows
Good afternoon,
I am trying to delete a range of over 150,000 rows. The code below works but takes an awful amount of time. Does anyone have any faster code? Thanks in advance Stephen!
I am trying to delete a range of over 150,000 rows. The code below works but takes an awful amount of time. Does anyone have any faster code? Thanks in advance Stephen!
Code:
Public Sub Makeit()
Dim sh2 As Worksheet
Set sh2 = Sheets("Sheet2")
Dim lastrow As Long
lastrow = Cells(Rows.Count, "AA").End(xlUp).row
For i = lastrow To 2 Step -1
If Cells(i, 27).Value <= #8/31/2017# Then
Cells(i, 1).EntireRow.Delete
End If
Next
End Sub