Insert one new copy row

Closed
ravenyaad Posts 2 Registration date Tuesday May 27, 2014 Status Member Last seen May 30, 2014 - May 27, 2014 at 01:59 PM
ravenyaad Posts 2 Registration date Tuesday May 27, 2014 Status Member Last seen May 30, 2014 - May 30, 2014 at 07:55 AM
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 June 14, 2009 Status Contributor Last seen August 7, 2021 811
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
0
ravenyaad 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 :)
0