Actually your way to loop through the range is correct and does not need Change when you start from the Bottom you do not screw up the process by deleteing a row.
Your code is perfectly fine you just delete the wrong row :D
it needs to be
Edit: Also i wanna mention that the initial code with the for loop performs around 33% better than the solution with the while loop. with a small data set that is not really noticable but in a dataset with 50k rows for example the for loop is running through in 2 minutes and the while loop needs 3 minutes which is a big difference.
You could speed up the process even more by reading everything into an array loop through that and only write back the values that you need. but unless you have a massive amount of Data that would not make much noticable difference.
Bookmarks