• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

VBA to create duplicate rows in new sheet.

xlnc

New Member
Hello Experts,

I am trying to create duplicate values a n number of times from a source sheet- 'Sheet1'
In sheet 2 the data should be as per the file attached. Can anyone help improvise the code or help me with a new code ?

Code:
Sub createdups()
    Dim lr As Long
    lr = ThisWorkbook.Sheets("Sheet1").Cells(Rows.Count, "A").End(xlUp).Row
    For i = 2 To lr
        Do
            Sheets("Sheet1").EntireRow.Copy Destination:=Sheets("sheet2").Cells(i + 1, "A")
            i = i + 1
        Loop Until i = 26
    Next
End Sub

Also I have attached a file for better understanding. Need urgent help please!

Thanks.
 

Attachments

  • Create duplicate rows (1).xlsm
    15.2 KB · Views: 3
Back
Top