Hi Carol,
Glad you were able to get it working. To explain the code...
First line is a defines a worksheet and it's range, and we Copy it. Pretty basic.
Second line is where we get a litte tricky. As you are inserting, not sure if this is what you used in end product, but I will explain. The line starts by looking in Sheet2, and we want a defined cell. the
Cells object takes 2 arguments, row number and column number/letter. We'll start at bottom of worksheet. Since some sheets have 65536 rows, but XL 2007+ has more, we can't hardcode this, so we just tell XL to count number of rows in the sheet and use that. Then we use the
End method. This is the same as when you use Ctrl+arrow key, to move to next cell with something in it. So, if we were at bottom of sheet and use
End to go Up, we'll end up at last cell with data in in, for that column. But, this isn't where we want to paste our data. So, we use
Offset. Offset also has 2 arguments, how many rows to offset, and how many columns to offset. We want to just move
1 row down.
Finally, we are ready to paste. We don't want to paste everything, so we use the
PasteSpecial method, and tell it to paste only the values.