Report

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

Ask a question V_angel54 2Posts Tuesday June 6, 2017Registration date June 8, 2017 Last seen - Last answered on Jun 9, 2017 at 03:17 AM by vcoolio
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!

Helpful
+0
plus moins
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 2Posts Tuesday June 6, 2017Registration date June 8, 2017 Last seen - Jun 8, 2017 at 02:53 PM
Thank you!
Reply
vcoolio 1064Posts Thursday July 24, 2014Registration date ModeratorStatus September 25, 2017 Last seen - Jun 9, 2017 at 03:17 AM
You're welcome V_Angel. Glad that I was ale to help.

Cheerio,
vcoolio.
Reply
Leave a comment

Member requests are more likely to be responded to.

Members can monitor the statuses of their requests from their account pages.

A CCM membership gives you access to additional options.

Not a member yet?

Sign up now. It takes less than a minute and is completely free!