I need to go over a data with a few thousand lines and edit specific rows based on values of a few fields (if they meet some criteria).
The problem is that it takes ages (~13 seconds per loop, sometimes I have 100 loops)... I tried also to make VBA filter the table then work on filtered rows but it took the same time.
While l < CurrAloc And k <= lastrow
If Cells(k, g) = "Pass" And Cells(k, h) <> "" And Cells(k, i) = "" And Cells(k, j) = "Available" Then
Cells(k, ULDecCol) = CurrCustomer
Cells(k, ULFromClassifierCol) = CurrClassifier
add_to_log k
Sheets("Unit List").Select
l = l + 1
End If
k = k + 1
Wend
Sheets("Unit List").Selectinside your loop, which is scanning thousands of lines as you say, and I am not sure what are you doing with this Select.Selecttakes a lot of time.add_to_log? How long does it take if you dont write that log? If you use Selecting of a different sheet in you log: try to write to that sheet without selecting.