Copy range and paste underneath "x" amount of times based on cell value

BJH1995

New Member
Joined
May 20, 2019
Messages
18
Hi All,

Some assistance if possible,

I would like to copy a dynamic range of data starting in cell "i15" and paste underneath this range the amount of times specified in cell "A17". if anyone can help?

Thanks,
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
Do you want to copy/paste I15 to the last row with data in col I?
 
Upvote 0
Try this:
VBA Code:
    Range("I15").Copy Range("I16:I" & Range("A17").Value + 15)
 
Upvote 0
Apologies if i haven't explained properly.

The range of data i have currently is within the range "I15:I20" but this will need to be dynamic as the range changes but will always start in cell "I15"

I would like to copy this range and paste underneath in the next blank cell, the amount of times which is stated within cell "A17"

If this still doesn't explain well i will upload an image.

Thanks,
 
Upvote 0
I think I would like to see a before/after picture.
 
Upvote 0
Hope this explains better.
 

Attachments

  • Before.JPG
    Before.JPG
    89.3 KB · Views: 9
  • After.JPG
    After.JPG
    111.9 KB · Views: 10
Upvote 0
How about
VBA Code:
Sub BJH()
   With Range("I15", Range("I" & Rows.count).End(xlUp))
      .Copy .Offset(.count).Resize(.count * Range("A17"))
   End With
End Sub
 
Upvote 0
Glad we could help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,793
Messages
6,121,619
Members
449,039
Latest member
Mbone Mathonsi

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