Copy a row and paste it down 119 times
Closed
ybiancheng
Posts
3
Registration date
Monday 22 September 2014
Status
Member
Last seen
6 February 2015
-
22 Sep 2014 à 09:07
venkat1926 Posts 1863 Registration date Sunday 14 June 2009 Status Contributor Last seen 7 August 2021 - 29 Sep 2014 à 01:19
venkat1926 Posts 1863 Registration date Sunday 14 June 2009 Status Contributor Last seen 7 August 2021 - 29 Sep 2014 à 01:19
Related:
- Copy a row and paste it down 119 times
- Saints row 2 cheats - Guide
- How to delete a row in word - Guide
- How to copy paste youtube link on android - Guide
- Pi copy paste - Guide
- E with accent copy paste - Guide
2 responses
venkat1926
Posts
1863
Registration date
Sunday 14 June 2009
Status
Contributor
Last seen
7 August 2021
811
23 Sep 2014 à 03:44
23 Sep 2014 à 03:44
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 14 June 2009
Status
Contributor
Last seen
7 August 2021
811
29 Sep 2014 à 01:19
29 Sep 2014 à 01:19
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.
28 Sep 2014 à 23:46
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!