VBA Code to copy Sheet1 to Sheet2 and paste in Row 2

rrickard

New Member
Joined
Jul 25, 2017
Messages
17
I need to copy Sheet 1 to Sheet 2 and paste special starting in Row 2 on Sheet 2.

The data on sheet 1 could change (# of rows & columns). I just want the paste special to start in row 2 of Sheet 2 so that row 1 doesn't get overwritten.

If I need to define the columns I probably could, but the row data will expand and shrink over time.

I have been using the below code, but it copies all cells between sheets impacting row 1 on Sheet 2 (which I don't want).

Sub Button1_Click()

Application.ScreenUpdating = False
Sheets("Sheet1").Cells.Copy
Sheets("Sheet2").Cells(1, 1).PasteSpecial Paste:=xlPasteValues
Application.CutCopyMode = False
ThisWorkbook.Worksheets("Sheet2").Cells.EntireColumn.AutoFit
Application.ScreenUpdating = True
End Sub
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
I need help copying from Sheet 1 to Sheet 2 and paste special starting in row 2. Row 1 (on sheet 1) has data which I want to be copied, but I need the entire sheet to be pasted starting in row 2 of sheet 2. Essentially shifting it all down one row.
 
Upvote 0
I should add, I have used the below code which works pretty good. But I have some static data in row 1 of Sheet 2 that I don't need overwritten with the copy.

Sub Button1_Click()
Application.ScreenUpdating = False
Sheets("Sheet1").Cells.Copy
Sheets("Sheet2").Cells(1, 1).PasteSpecial Paste:=xlPasteValues
Application.CutCopyMode = False
ThisWorkbook.Worksheets("Sheet2").Cells.EntireColumn.AutoFit
Application.ScreenUpdating = True
End Sub
 
Upvote 0
Code:
Sub Button1_Click()
Application.ScreenUpdating = False
Sheets("Sheet1").Activate
Range([A1], ActiveSheet.UsedRange).Copy
Sheets("Sheet2").Cells(2, 1).PasteSpecial Paste:=xlPasteValues
Application.CutCopyMode = False
Sheets("Sheet2").Cells.EntireColumn.AutoFit
Application.ScreenUpdating = True
End Sub
 
Upvote 0
Here would be a way to do that. I think i would rather just paste the correct amount of data though.

Code:
Sheets("Sheet1").Cells.Resize(Rows.Count - 1).Copy
Sheets("Sheet2").Cells(2, 1).PasteSpecial xlPasteValues
 
Upvote 0
I have merged your two threads together.

In the future, please be careful not to post the same question multiple times. All clarifications, follow-ups, and bumps should be posted back to the original thread. Per forum rules, posts of a duplicate nature will be locked or deleted (rule #12 here: Forum Rules).

Note that sometimes posts from new users require Moderator approval before you can see them (you will see a message to this effect). Please be patient for that to happen (don't try posting the question again).

Thank you.
 
Last edited:
Upvote 0
What if I want to stay on Sheet2 after the copy? Using footoo's code after the script it returns me to Sheet 1 (I have a button on Sheet2 that executes the copy).
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,183
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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