You don't have to append the last row. It is a trick that I use to avoid having an IF-THEN/ELSE statement inside the DO loop (as in your original code). It makes the code a little easier to read, and slightly more efficient, as explained in this blog post: Avoid unnecessary IF-THEN statements in loops - The DO Loop
... View more