Copy a row and paste it down 119 times
Closed
ybiancheng
Posts
3
Registration date
Monday September 22, 2014
Status
Member
Last seen
February 6, 2015
-
Sep 22, 2014 at 09:07 AM
venkat1926 Posts 1863 Registration date Sunday June 14, 2009 Status Contributor Last seen August 7, 2021 - Sep 29, 2014 at 01:19 AM
venkat1926 Posts 1863 Registration date Sunday June 14, 2009 Status Contributor Last seen August 7, 2021 - Sep 29, 2014 at 01:19 AM
Related:
- Copy a row and paste it down 119 times
- Saints row 2 cheats - Guide
- Times attack - Download - Children
- How to delete a row in a table in word - Guide
- Computer beeps 3 times no display ✓ - CPU & Desktop Forum
- Hp desktop red light flashing 4 times - Hardware Forum
2 responses
venkat1926
Posts
1863
Registration date
Sunday June 14, 2009
Status
Contributor
Last seen
August 7, 2021
811
Sep 23, 2014 at 03:44 AM
Sep 23, 2014 at 03:44 AM
data is like this col A to D(copy sheet 1 to shee2 also to preserve original data)
A1 B1 C1 D1
A2 B2 C2 D2
A3 B3 C3 D3
for experiment in the macro I have used m=10 that is repeated 10 time. you can change this code as you like.
macro is
A1 B1 C1 D1
A2 B2 C2 D2
A3 B3 C3 D3
for experiment in the macro I have used m=10 that is repeated 10 time. you can change this code as you like.
macro is
Sub test()
Application.ScreenUpdating = False
Dim j As Long, k As Long, m As Long
m = 10
Worksheets("sheet1").Activate
j = Range("A1").End(xlDown).Row
For k = j To 1 Step -1
Cells(k, 1).EntireRow.Copy
Range(Cells(k, 1), Cells(k + m, 1)).EntireRow.Insert
Next k
Application.ScreenUpdating = True
Application.CutCopyMode = False
End Sub
venkat1926
Posts
1863
Registration date
Sunday June 14, 2009
Status
Contributor
Last seen
August 7, 2021
811
Sep 29, 2014 at 01:19 AM
Sep 29, 2014 at 01:19 AM
adjust m value to get what you want
as entire row is copied I expect it does not matter the cells in the first column of row is blank.
as entire row is copied I expect it does not matter the cells in the first column of row is blank.
Sep 28, 2014 at 11:46 PM
I tried the codes, and there are two issues that I hope you can help me with further:
1) Each row was copied 12 time down (including the original data), rather than 10 times. I wonder why that is the case?
2) I realized that for some of my data, the first cell is actually blank (but the remaining ones have data). Those rows need to be copied as well, but are ignoed by the macro. I was wondering if there is any way to have the macro include those rows as well. So for instance:
A1 B1 C1 D1
A2 B2 C2 D2
B3 C3 D3
The macro would ingore the 3rd row. Can the codes be amended to include the 3 row as well?
Thanks a lot!