forensic93
New Member
- Joined
- Jan 14, 2020
- Messages
- 16
- Office Version
- 2016
- Platform
- Windows
hello,
I have created some code that will delete an entire row based on if the value 1 is in the column or not.
The code works but takes 40 minutes to run on 300,000 lines.
Is there a better method to make this work?
I have created some code that will delete an entire row based on if the value 1 is in the column or not.
The code works but takes 40 minutes to run on 300,000 lines.
Is there a better method to make this work?
VBA Code:
Sub Delete_Rows()
Dim i As Long
Dim LastRow As Long
Application.ScreenUpdating = False
LastRow = ActiveSheet.Cells(ActiveSheet.Rows.Count, "E").End(xlUp).Row
For i = LastRow To 2 Step -1
If Cells(i, "E") < "1" Then Rows(i).EntireRow.Delete
Next i
Application.ScreenUpdating = True
End Sub
Last edited: