I am recording a macro which includes taking a text string and using the mid function to extract 7 characters from this string. Once I have performed the function, I then need to copy it down the remaining cells. This works fine on the current download of my file, but subsequent downloads vary in terms of the number of rows. I have tried copying the formula down to row 65,536 to ensure it picks up all active rows but now I am left with thousands of blank rows which I would like to delete. Is there a way of copying the formula to the last active row or is there a way of deleting all rows after the last active row.

Thanks

Shirley