+ Reply to Thread
Results 1 to 3 of 3

Copy and Paste Range Down X times

Hybrid View

  1. #1
    Registered User
    Join Date
    09-02-2012
    Location
    Singapore
    MS-Off Ver
    Excel 2007
    Posts
    77

    Copy and Paste Range Down X times

    Hi all,

    I am really bad with macro and would like to seek your help.

    I need a macro which can copy a range and paste it down X number of times. I have attached an image as an example.

    The range will be predefined e.g. ("A2:W8")

    Capture.PNG

    Thank you so much for your time and help.
    Regards,
    Hyperdude

  2. #2
    Registered User
    Join Date
    09-02-2012
    Location
    Singapore
    MS-Off Ver
    Excel 2007
    Posts
    77

    Re: Copy and Paste Range Down X times

    Hi all,

    I found the solution below. Thank you.

    Sub Test()
    
    Dim RepNum As Integer
    
    Dim nextrow As Long, i As Long
    
    Application.ScreenUpdating = False
    
    RepNum = Sheets("Starting Inventory").Range("S1").Value
    
    With Sheet1
            .Range("D3:W8").Copy
            For i = 1 To RepNum
                nextrow = .Cells(Rows.Count, "E").End(xlUp).Row
                Range("D" & nextrow + 1).PasteSpecial
            Next i
            
        End With
        
        Application.CutCopyMode = False
        Application.ScreenUpdating = True
    End Sub

  3. #3
    Valued Forum Contributor mohan.r1980's Avatar
    Join Date
    09-18-2010
    Location
    Mumbai, India
    MS-Off Ver
    Excel 2010 (windows7)
    Posts
    729

    Re: Copy and Paste Range Down X times

    Hi

    try Below code
    Sub test()
    
    Dim myRange As Range, r As Range, iTimes As Integer, i As Integer
    Dim sht1 As Worksheet
    Set sht1 = Worksheets("Sheet1")
    Set myRange = sht1.Range("A2:W8")
        
    iTimes = Application.InputBox("Reuired Number", "How many times you want to paste")
     
    For i = 1 To iTimes
        myRange.Copy sht1.Range("A" & Range("a" & Rows.Count).End(xlUp).Row).Offset(2)
    Next i
    
    End Sub
    Regards,
    MohanS


    "Perfection is not attainable, but if we chase perfection we can catch excellence." - Vince Lombardi

    You can simply say thanks by clicking "*Add Reputation" icon

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Copy range of cells and paste them X number of times with a jump of 4
    By arbazhamayun in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-07-2018, 11:25 AM
  2. [SOLVED] Copy rows/range and paste n number of times based on last used cell in Column A
    By skonduru in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-29-2016, 02:30 PM
  3. Copy/Paste Range Several Times while changing a few cells in 1-2 rows
    By smiket in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-04-2015, 04:00 PM
  4. copy a range of cells N times and paste in separate sheet and also change a specific colum
    By maramkarthik in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-21-2013, 04:27 AM
  5. [SOLVED] Macro to copy a cell range and paste to a new sheet 'n' times where 'n' defined by formula
    By staminaboy in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-26-2013, 11:39 AM
  6. [SOLVED] Macro to copy/paste dynamic range x times into same sheet
    By BigAl_Qld in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-19-2013, 03:48 AM
  7. [SOLVED] Copy and paste a range x many times
    By acsta14 in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 08-20-2012, 07:15 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1