nniedzielski
Well-known Member
- Joined
- Jan 8, 2016
- Messages
- 598
- Office Version
- 2019
- Platform
- Windows
I have this code that i am running that works, but this section is taking about 12 seconds to run, its deleting around 12k rows.
Is there a way to speed it up?
Is there a way to speed it up?
VBA Code:
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Application.EnableEvents = False
Dim we as worksheet
' Filter column C for "Yes"
ws.Range("C1").AutoFilter Field:=3, Criteria1:="Yes"
' Delete filtered rows
lastRow = ws.Cells(ws.Rows.Count, "C").End(xlUp).Row
ws.Range("C2:C" & lastRow).SpecialCells(xlCellTypeVisible).EntireRow.Delete
' Turn off filter
ws.AutoFilterMode = False
Application.ScreenUpdating = true
Application.DisplayAlerts = true
Application.EnableEvents = true