Hi there,
The fundamental problem occurs in the following line:
The equivalent line for z1 works because there are no blank cells in the range, but new rows will have been inserted before the above line of code is executed, and therefore z2 will refer to the cell immediately above the first newly-inserted row, rather than the last non-blank cell in the column.
Try the following routine and see if it does what you want:
Defining the various parameters as Const(ants) keeps them in a convenient location in case they ever need to be changed in response to changes in worksheet layout etc.
Hope this helps - please let me know how you get on.
Regards,
Greg M
Bookmarks