Hey everyone. I'm back with another question.
I have a worksheet where I need to delete rows from my dataset. My code is pretty simple I think:
(LastRow has been dimmed as a variable and finds the last row of data - last time it ran it was 8705 lines)
Range("A1:BS" & LastRow).AutoFilter Field:=4, Criteria1:="<>*Small*", Operator:=xlAnd
Rows("2:" & LastRow).Select
Selection.Delete Shift:=xlUp
Activesheet.ShowAllData
The number of lines deleted is about 4200.
I use this code all the time in various and much larger workbooks and it has never given me a problem before. In this current workbook it's giving me fits. It is taking anywhere from 5 to 7 mins to run.
Does anyone have any thoughts or ideas how I might speed this up?
Bookmarks