finding the last row for a macro

  • Thread starter Thread starter Mctabish
  • Start date Start date
M

Mctabish

I want to copy an item from on cell in worksheet3 (CO2) and then paste it in
worksheet1 (CO2) then copy this all the way down to the last row. I would
like to do this in a macro. I have tried recording this several ways, but it
is not reliable.

Also, I would like to go to the bottom row, and fill lastrow,A through
lastrow,colCN with the value of lastrow,A

How would this macro look?

Thanks
Mc
 
Sub copyrange()

Sheets("sheet1").Range("CO2") = Sheets("sheet3").Range("CO2")
Sheets("sheet1").Activate

Lastrow = Cells(Rows.Count, 1).End(xlUp).Row

Cells(Lastrow, 1).Copy Destination:=Range("B" & CStr(Lastrow) & ":CN" &
CStr(Lastrow))

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

Back
Top