Insert one new copy row

Closed
ravenyaad Posts 2 Registration date Tuesday 27 May 2014 Status Member Last seen 30 May 2014 - 27 May 2014 à 13:59
ravenyaad Posts 2 Registration date Tuesday 27 May 2014 Status Member Last seen 30 May 2014 - 30 May 2014 à 07:55
i need help pleas :)

i want to insert one new row every time Verifies the condition and also copy some cells from last row

like

if(y3="y","insert one new row"&"copy a3,b3,d3,e3,...)

a2 b2 d2 y2
x1 x2 x3 y
a3 b3 d3
x1 x2 x3

thank for help
Related:

2 responses

venkat1926 Posts 1863 Registration date Sunday 14 June 2009 Status Contributor Last seen 7 August 2021 811
30 May 2014 à 02:09
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 Posts 2 Registration date Tuesday 27 May 2014 Status Member Last seen 30 May 2014
30 May 2014 à 07:55
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 :)