cparks
Member
I have a button that when clicked, it copies to the last row of data, then pastes it into another worksheet.
My problem is it gives me an Error Message dealing with the "paste" section of the code.
And it pastes under A2, it needs to be in B2.
I just want to get rid of all the blank cells under the last row of data when pasted.
Suggestions? Where did I go wrong?
Thanks.
My problem is it gives me an Error Message dealing with the "paste" section of the code.
And it pastes under A2, it needs to be in B2.
I just want to get rid of all the blank cells under the last row of data when pasted.
Code:
Sub Button10_Click()
Application.ScreenUpdating = False
Dim copySheet As Worksheet
Dim pasteSheet As Worksheet
Dim Last_Row As Long
Set copySheet = Worksheets("Data Entry Sheet")
Set pasteSheet = Worksheets("Main Data Sheet")
Last_Row = Range("G2").End(xlDown).Offset(1).Row
copySheet.Range("G2:M2").Copy Range("G" & Last_Row)
pasteSheet.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).PasteSpecial xlPasteValues
Application.CutCopyMode = False
Application.ScreenUpdating = True
End Sub
Suggestions? Where did I go wrong?
Thanks.