Copy to last line of data and paste

AggyRJ

New Member
Joined
Mar 29, 2013
Messages
16
I have a workbook with two spreadsheets. Sheet 1 is "working data" and sheet 2 is "Solution" As the title suggests, in sheet 1 is where all my calculations are performed, then it is pasted into sheet 2 and formatted. My issue is I need the information from "working data" to be copied and pasted into "Solution" but the information from "working data" will have a variable amount of rows (currently there are over 10,000, but their could be a few thousand more in any given month. The copied range from "working data" will always start in cell A1 and then should select all rows down until it finds a cell in column A empty, then the data should be pasted into "Solution" starting with cell A40. Any help will be greatly appreciated.
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
1. Should any existing data in "Solution", row 40 and down, be deleted first?
 
Upvote 0
1. Should any existing data in "Solution", row 40 and down, be deleted first?
Assuming the answer is "Yes", try this in a copy of your workbook.

<font face=Courier New><br><SPAN style="color:#00007F">Sub</SPAN> MoveWorkingData()<br>  <SPAN style="color:#00007F">With</SPAN> Sheets("Solution")<br>    <SPAN style="color:#00007F">On</SPAN> <SPAN style="color:#00007F">Error</SPAN> <SPAN style="color:#00007F">Resume</SPAN> <SPAN style="color:#00007F">Next</SPAN><br>    Intersect(.UsedRange, .Rows("40:" & .Rows.Count)).ClearContents<br>    <SPAN style="color:#00007F">On</SPAN> <SPAN style="color:#00007F">Error</SPAN> <SPAN style="color:#00007F">GoTo</SPAN> 0<br>    Sheets("Working Data").UsedRange.Copy<br>    .Range("A40").PasteSpecial Paste:=xlPasteValues<br>  <SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">With</SPAN><br>  Application.CutCopyMode = <SPAN style="color:#00007F">False</SPAN><br><SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">Sub</SPAN><br></FONT>
 
Upvote 0

Forum statistics

Threads
1,214,979
Messages
6,122,551
Members
449,088
Latest member
davidcom

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