I'm writing a macro to prompt for a user entered category and loop through ~ 40k rows and delete all except their category (with the largest category this would be ~8k left, so deleting 32k rows). I'm thinking there has to be a more efficient way to do this, its been running at least 7 minutes (have a timer, running, i'll post when complete)
Sub category()
Workbooks("Book1.xlsx").activate
dim category as variant
category = InputBox("What Category are you analyzing?")
Rowcount = application.worksheetfunction.countA(Range("A:A"))
For i =RowCount to 2 Step -1
If cells(i,3).value <> category Then
Rows(i).delete
End If
Next
It ended up taking 18 minutes. There has to be a way to speed this up!
Sub category()
Workbooks("Book1.xlsx").activate
dim category as variant
category = InputBox("What Category are you analyzing?")
Rowcount = application.worksheetfunction.countA(Range("A:A"))
For i =RowCount to 2 Step -1
If cells(i,3).value <> category Then
Rows(i).delete
End If
Next
It ended up taking 18 minutes. There has to be a way to speed this up!