Forum Discussion
ML_PT
Jul 20, 2021Copper Contributor
Copy cells to Last Row, Paste to another sheet to Last Row (1rst EMPTY ROW, adding, not replacing)
Hello friends. Im New in VBA. Could you help me on this?
So, i have 5 Cells D8:H8 with data, in Sheet1
I want to COPY those cells from Sheet1
and paste it to Sheet2, columns A to E in FIRST EMPTY ROW (i mean by adding more data, cause A to E is supposed to have previous data)
Can anyone help? It would be a huge favour for me! THANKS !!
ML
Hi, I use something similar in my day to day work. This should work for your purposes, this functions assuming you have headers on sheet 2.
Sub Transfer() LastRow = [Sheet2].Cells(Rows.Count, 1).End(xlUp).Row NextRowExport = LastRow + 1 [Sheet1].Range("D8:H8").Copy [Sheet2].Range("A" & NextRowExport).PasteSpecial xlPasteValues End Sub
6 Replies
- DKoontzIron Contributor
Hi, I use something similar in my day to day work. This should work for your purposes, this functions assuming you have headers on sheet 2.
Sub Transfer() LastRow = [Sheet2].Cells(Rows.Count, 1).End(xlUp).Row NextRowExport = LastRow + 1 [Sheet1].Range("D8:H8").Copy [Sheet2].Range("A" & NextRowExport).PasteSpecial xlPasteValues End Sub