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

Posts
2
Registration date
Tuesday June 6, 2017
Status
Member
Last seen
June 8, 2017
-
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 

1 reply

Posts
1251
Registration date
Thursday July 24, 2014
Status
Moderator
Last seen
September 29, 2019
207
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.
V_angel54
Posts
2
Registration date
Tuesday June 6, 2017
Status
Member
Last seen
June 8, 2017
-
Thank you!
vcoolio
Posts
1251
Registration date
Thursday July 24, 2014
Status
Moderator
Last seen
September 29, 2019
207 > V_angel54
Posts
2
Registration date
Tuesday June 6, 2017
Status
Member
Last seen
June 8, 2017
-
You're welcome V_Angel. Glad that I was ale to help.

Cheerio,
vcoolio.