VBA Advise

  • Thread starter Thread starter RB
  • Start date Start date
R

RB

Hi
I hope if someone can help show me a cleaner way of doing the following
things. I tried the recorder & it comes up with huge code

* Copy a Row e.g Row 5 from sheet 1 to sheet 2 at the end of last row
* Copy a formula from a row/cell to all the way to last row

Thanks in advance for your help
 
RB

One way.
Copy a row:
Assuming that you are in sheet1 then
Cells(5, 1).EntireRow.Copy Destination:=Sheets
("sheet2").Range("a65536").End(xlUp).Offset(1, 0)

Copy a formula:
Assuming that you are in the cell that you want copied and
that column A has an entry in the last cell that you want
the formula copied down to then:
ActiveCell.Copy Destination:=Range(Cells(ActiveCell.Row,
ActiveCell.Column), Cells(Range("a65536").End(xlUp).Row,
ActiveCell.Column))

Tony
 
Back
Top