Copy cells from sheet 1, paste to next blank row in sheet 2

jonman03

Board Regular
Joined
May 26, 2009
Messages
69
Hello all -

Fairly simple request here, but can't get the VBA corret to do it right:

I need to copy values in cells A2:B2 on Sheet 1 and paste values to the next blank row in columns A&B on Sheet 2.

Thank you very much for the help!
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
see if this helps
Code:
Sub CopyPaste()
Worksheets("Sheet1").Range("A2:B2").Copy Destination:=Worksheets("Sheet2").Cells(Range("A65536").End(xlUp).Row + 1, "A")
End Sub
 
Upvote 0
That is copying the data and pasting it into Sheet2, but in row 12. I only have content in row 1 of Sheet2, so it should be pasting to row 2... Any ideas?
 
Upvote 0
jfish:

I think it was pasting +1 row from the currently selected cell. I believe I have it working with the code below:

Code:
Sub CopyPaste()
Worksheets("Sheet2").Range("A1").Select
Worksheets("Sheet1").Range("A2:B2").Copy Destination:=Worksheets("Sheet2").Cells(Range("A65536").End(xlUp).Row + 1, "A")
End Sub

Thank you for your help!
 
Upvote 0

Forum statistics

Threads
1,224,522
Messages
6,179,297
Members
452,903
Latest member
Knuddeluff

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top