Copy/paste a range 'n' times. [Solved/Closed]

Posts
2
Registration date
Tuesday June 6, 2017
Last seen
June 8, 2017
- Jun 6, 2017 at 03:01 PM - Latest reply:
Posts
1204
Registration date
Thursday July 24, 2014
Status
Moderator
Last seen
November 11, 2018
- Jun 9, 2017 at 03:17 AM
Hello,

I have a highlighted portion and I want to copy and paste it 200 times. Is there a code or formula to do this automatically? Or must I hit crtl+v 200 times? Help I have limited knowledge on formulas and code in excel.

Thank you!

See more 

3 replies

Posts
1204
Registration date
Thursday July 24, 2014
Status
Moderator
Last seen
November 11, 2018
- Jun 8, 2017 at 03:14 AM
0
Thank you
Hello V_Angel54,

I assume that you simply high-light the data range that you wish to copy x number of times and that you paste it at the bottom of the existing data set in the same sheet. If so, the following code, placed in a standard module and assigned to a button may do the task for you:-

Sub CopySelection()

    Dim SCT As Long '----> SCT simply stands for "Selection Copy Times"
    Dim i As Long

SCT = Sheet1.[E1].Value
    
    If SCT > 0 Then
        For i = 1 To SCT
            Selection.Copy Sheet1.Range("A" & Rows.Count).End(3)(2)
        Next i
    End If
    
Sheet1.[E1] = ""
Application.CutCopyMode = False

End Sub


Following is the link to a small sample I made up for you to play with:-

https://www.dropbox.com/s/did79tutwlcqi1l/Copy%20selection%20n%20times.xlsm?dl=0

Enter the number of times that you wish to copy any selection into the yellow box (cell E1), select(high-light) the range that you wish to copy and click on the "RUN" button. The selection will be copied to the bottom of the existing data set the number of times that you have entered into the yellow box (cell E1).

I hope that this helps,

Cheerio,
vcoolio.
Posts
2
Registration date
Tuesday June 6, 2017
Last seen
June 8, 2017
- Jun 8, 2017 at 02:53 PM
Thank you!
Posts
1204
Registration date
Thursday July 24, 2014
Status
Moderator
Last seen
November 11, 2018
>
Posts
2
Registration date
Tuesday June 6, 2017
Last seen
June 8, 2017
- Jun 9, 2017 at 03:17 AM
You're welcome V_Angel. Glad that I was ale to help.

Cheerio,
vcoolio.