Need Macro- Copy Row and Insert 10 times
Solved/Closed
nycm
nycm
- Posts
- 6
- Registration date
- Monday October 28, 2013
- Status
- Member
- Last seen
- October 31, 2013
nycm
- Posts
- 6
- Registration date
- Monday October 28, 2013
- Status
- Member
- Last seen
- October 31, 2013
Related:
- Need Macro- Copy Row and Insert 10 times
- Text to n rows + copy row and insert n times ✓ - Forum - Excel
- Copy row and insert n times ✓ - Forum - Office Software
- Macro to copy/paste down X times (where X is the number of rows) ✓ - Forum - Excel
- EXCEL MACRO TO REPEAT AND INSERT ROWS ✓ - Forum - Excel
- Copy and insert rows and number of times ✓ - Forum - Excel
2 replies
venkat1926
Oct 28, 2013 at 11:06 PM
- Posts
- 1864
- Registration date
- Sunday June 14, 2009
- Status
- Contributor
- Last seen
- August 7, 2021
Oct 28, 2013 at 11:06 PM
data is like this in sheet1 from A1
hdng1 hdng2 hdng3
TextA TextA1 TextA2
TextB TextB1 TextB2
TextC TextC1 TextC2
now try this macro
in the macro there is a statement
j=10
that is the rows in sheet1 will be copied 10 times. if you want different number modifgy this statement
result in sheet 3
hdng1 hdng2 hdng3
TextA TextA1 TextA2
TextB TextB1 TextB2
TextC TextC1 TextC2
now try this macro
in the macro there is a statement
j=10
that is the rows in sheet1 will be copied 10 times. if you want different number modifgy this statement
result in sheet 3
Sub test()
Dim j As Integer, r As Range, c As Range, r1 As Range, r2 As Range
j = 10
Application.ScreenUpdating = False
Worksheets("sheet3").Cells.Clear
Set r = Range(Range("A2"), Range("A2").End(xlDown))
For Each c In r
Range(c, c.End(xlToRight)).Copy
With Worksheets("sheet3")
Set r1 = .Cells(Rows.Count, "A").End(xlUp).Offset(1, 0)
.Range(r1, r1.Offset(j - 1, 0)).PasteSpecial
End With
Next c
Application.CutCopyMode = False
Application.ScreenUpdating = True
End Sub
nycm
Oct 29, 2013 at 09:41 AM
- Posts
- 6
- Registration date
- Monday October 28, 2013
- Status
- Member
- Last seen
- October 31, 2013
Oct 29, 2013 at 09:41 AM
Hi Venkat1926,
It worked first try! Thank you so much for your help!
It worked first try! Thank you so much for your help!