PDA

View Full Version : Solved: Instruct Insert Row Above...



YellowLabPro
09-09-2006, 08:27 AM
My Code inserts a new row and then performs its copy to this row. What I need it to do rather is to insert the row above and copy there.
I am not sure how to address this.




For i = Cells(Rows.Count, "D").End(xlUp).Row To 3 Step -1
If Cells(i, "D") = "Insert" Then
Cells(i, "D").EntireRow.Insert
Cells(i + 1, "D").EntireRow.Copy Destination:=Cells(i, 1)
Cells(i + 1, "D").Formula = "=IF(LEFT(W" & i + 1 & ",2)=""~P"",""""," & _
"IF(AND(LEFT(W" & i + 1 & ",2)=""~C"",LEFT(U" & i + 1 & ",8)<>" & _
"LEFT(U" & i & ",8)),""Insert"",""""))"
Cells(i + 1, "D").Copy Destination:=Cells(i, "D")
Cells(i + 1, "N").ClearContents
Cells(i + 1, "Z").Value = 0
Cells(i + 1, "AC").Value = 1998
End If



Any ideas? : pray2:

Thanks,
YLP

YellowLabPro
09-09-2006, 08:34 AM
Please Disregard. I am doing some further research.