Need simple macro to copy and paste values

B

Bern Notice

I need to write a macro to copy 2 total cells from the bottom of one sheet
and paste those values into cells on another sheet. The total cells on
"sheet 1" are in Columns C and D and are one row below the last data in
columns A & B. Also, there will be a varying number of rows on "sheet 1" at
different times.

The cells on "sheet 2" that I need to paste the values in are D2 and E2.

This is actually going to be an addition to a current macro that I have
started, but I can't get this simple task to work. :(
 
J

JLGWhiz

This assumes that there is no data in columns A & B below
the Total line.

Sub sl()
Dim lr As Long
lr = Sheets("Sheet1").Cells(Rows.Count, 1).End(xlUp).Row
Range("A" & lr & ":B" & lr).Copy Sheets("Sheet2").Range("D2")
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top