I have a problem with my macro. It deletes row that fullfil certain criteria. But when few consecutive rows fullfil those criteria an error occurs. When the row is deleted t
If you're looping and deleting rows, you need to start at the bottom and work up:
For x = endrow To startrow step -1
Then deleting rows will not disrupt your loop.
Another alternative is to put x=x-1 after each delete. But working from the bottom up is better.
Loop forward:
For i = 1 To 10
'Do something
Next i
Loop backwards (use Step -1
at the end of the for loop):
For i = 10 To 1 Step -1
'Do something
Next i