Tim Hanson
Member
The macro works well it deletes rows if there are less then N instances of a cells value in a column but I have large data sets and it can take along time to for it to execute
I was hoping someone knows how to seed this one up or has a faster method
Thank you
I was hoping someone knows how to seed this one up or has a faster method
Thank you
Code:
Sub DeleteLessThen_N()
Dim ws As Worksheet
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
Set ws = ThisWorkbook.Sheets("EdgeFile")
ws.Select
With ws.Range("B2", Cells(Rows.Count, 2).End(xlUp))
.Value = Evaluate("=IF(COUNTIF(" & .Address & "," & .Address(1, 2) & ")<3,TRUE," & .Address & ")")
On Error Resume Next
.SpecialCells(2, 4).EntireRow.Delete
End With
Range("A1").End(xlDown).Offset(1).Resize(ActiveSheet.UsedRange.Rows.Count).EntireRow.Delete
On Error GoTo 0
End Sub