Insert one new copy row
Closed
ravenyaad
ravenyaad
- Posts
- 2
- Registration date
- Tuesday May 27, 2014
- Status
- Member
- Last seen
- May 30, 2014
ravenyaad
- Posts
- 2
- Registration date
- Tuesday May 27, 2014
- Status
- Member
- Last seen
- May 30, 2014
Related:
- How to insert specific number of rows at fixed intervals in excel
- Insert multiple copied rows at fixed intervals - Forum - Excel
- Excel - Repeat rows a specified number of times ✓ - Forum - Excel
- Copy Specific number of rows and insert n time after 3 rows - Forum - Excel
- Insert X Number of Rows Below Based on Value of X - Forum - Excel
- Inserting certain number of rows - Forum - Excel
2 replies
venkat1926
May 30, 2014 at 02:09 AM
- Posts
- 1864
- Registration date
- Sunday June 14, 2009
- Status
- Contributor
- Last seen
- August 7, 2021
May 30, 2014 at 02:09 AM
try this macro
Sub test()
Dim j As Integer, k As Integer
j = Cells(Rows.Count, "A").End(xlUp).Row
For k = j To 2 Step -1
If Cells(k, "Y") = "y" Then Cells(k, "Y").EntireRow.Insert
Next k
End Sub
ravenyaad
May 30, 2014 at 07:55 AM
- Posts
- 2
- Registration date
- Tuesday May 27, 2014
- Status
- Member
- Last seen
- May 30, 2014
May 30, 2014 at 07:55 AM
Thank you very much for your attention
This code can not solve my problem,I was able to solve the first part
((i can add a new row when the condition is met))
like
"Sub AddRows()
Dim lLoop As Long
Dim rFound As Range
With Range("k:k")
Set rFound = .Cells(3, 1)
For lLoop = 1 To WorksheetFunction.CountIf(.Cells, "y")
Set rFound = .Cells.Find("y", rFound, xlValues, , , xlNext, False)
rFound(2, 1).EntireRow.Insert
Next lLoop
End With
End Sub"
The second part is very difficult for me....
i need when insert new row to copy 5cell from
The previous row which have the condition in cell y3
Excuse me if my English is not good
Because it is not my native language
Thank you again :)
This code can not solve my problem,I was able to solve the first part
((i can add a new row when the condition is met))
like
"Sub AddRows()
Dim lLoop As Long
Dim rFound As Range
With Range("k:k")
Set rFound = .Cells(3, 1)
For lLoop = 1 To WorksheetFunction.CountIf(.Cells, "y")
Set rFound = .Cells.Find("y", rFound, xlValues, , , xlNext, False)
rFound(2, 1).EntireRow.Insert
Next lLoop
End With
End Sub"
The second part is very difficult for me....
i need when insert new row to copy 5cell from
The previous row which have the condition in cell y3
Excuse me if my English is not good
Because it is not my native language
Thank you again :)