Copy rows of data to another sheet

pwill

Active Member
Joined
Nov 22, 2015
Messages
406
Hi can anyone help?

I want to copy 14 rows of data from sheet2 "E:K" to sheet1 "T5:Z18"

I have a start row value on sheet3 "Q2" and want the data being copied from sheet2 to start from the row based on the value in sheet3 "Q2"

ie
If the value on sheet3 "Q2" has 21 then the data to be copied on sheet2 would be "E21:K34"

If the value on sheet3 "Q2" has 50 then the data to be copied on sheet2 would be "E50:63"

And so on...

Any help would be appreciated

Regards

pwill
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
How about
Code:
Sub CopyData()
   Sheet2.Range("E" & Sheet3.Range("Q2").Value).Resize(14, 7).Copy Sheet1.Range("T5")
End Sub
 
Upvote 0
Hi Fluff,

Thanks for that, can't try it out just now but will give it a go later and let u know how I get on. I'm sure it will work fine :)

Just a quick thought, would it be possible to have the code 'equal' the data instead of usuing copy and paste?

pwill
 
Upvote 0
Try
Code:
Sub CopyData()
   Sheet1.Range("T5").Resize(14, 7).Value = Sheet2.Range("E" & Sheet3.Range("Q2").Value).Resize(14, 7).Value
End Sub
 
Upvote 0
Try
Code:
Sub CopyData()
   Sheet1.Range("T5").Resize(14, 7).Value = Sheet2.Range("E" & Sheet3.Range("Q2").Value).Resize(14, 7).Value
End Sub

Works Perfect :) Thanks again Fluff, much appreciated

pwill
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,910
Messages
6,175,318
Members
452,634
Latest member
cpostell

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