Looping through rows in a ListObject to delete them is very slow
问题 I have a ListObject table with ~500 rows, I've also got 4 values in a named range. There are maybe 30 unique values that occur repeatedly (At random) for the 500 rows, I want to delete all rows whose values are not in the named range. I have the following which works, but it is running slower than expected (approximately 2 min): Sub removeAccounts() Dim tbl As ListObject Dim i As Integer Set tbl = ThisWorkbook.Sheets("TheSheet").ListObjects("TheTable") i = tbl.ListRows.Count While i > 0 If