nniedzielski
Well-known Member
- Joined
- Jan 8, 2016
- Messages
- 598
- Office Version
- 2019
- Platform
- Windows
Hi all-
I am running this section of code, which does a quick filter and deletes all the filtered info, which is round 20k rows. Its running really slow, this section is taking roughly 180 seconds to run. Is there a method that would speed this up at all?
thank you,
I am running this section of code, which does a quick filter and deletes all the filtered info, which is round 20k rows. Its running really slow, this section is taking roughly 180 seconds to run. Is there a method that would speed this up at all?
VBA Code:
' Filter column N for False
ws.Range("N1").AutoFilter Field:=14, Criteria1:="False"
' Delete all visible rows except header row
lastRow = ws.Cells(ws.Rows.Count, "N").End(xlUp).Row
Dim visibleRows As Range
Set visibleRows = ws.Range("N2:N" & lastRow).SpecialCells(xlCellTypeVisible)
If Not visibleRows Is Nothing Then visibleRows.EntireRow.Delete
' Remove filter
ws.AutoFilterMode = False
thank you,