There is a problem with your approach... it is your use of the xlLastCell
argument to the SpecialCells property. The "last cell" that gets returned is
the last cell of the UsedRange which may or may not be the last cell with
data in it. Try this experiment to see why. Type something in A1 (it doesn't
matter what) and then copy it across to, say, G1. Now select the range A1:G1
and copy it down to, say, Row 15. Now go to the Immediate Window of the VB
editor and execute this line in it...
? ActiveCell.SpecialCells(xlLastCell).Address
It should print out $G$15 as expected. Okay, go back to the worksheet, click
into a cell outside of the data area, say cell M25, then type anything (it
doesn't matter what) into that cell and hit the Enter key. Now click back
into that cell and press the Delete key. Now go back to the Immediate Window
and re-execute the above statement. It should now print $M$25... the address
of the cell you just deleted the last entry from; which, of course, is not
the last row of data.
Even without the above problem, I also note that your code assumes the last
cell on the worksheet is in columns A through R. This is not necessarily the
case. The OP asked for blank cells to be inserted above the last row of data
in columns A through R only. If there is data in columns beyond Row R and/or
in rows at or beyond the last row of data within columns A through R, then
your code will affect them as well. In other words, even if the SpecialCells
method you used worked correctly, you would still be identifying the wrong
last cell for such a situation.