DougStroud
Well-known Member
- Joined
- Aug 16, 2005
- Messages
- 2,976
- Office Version
- 365
- Platform
- MacOS
Here is my existing code- this was written by ACW and works fantastic. But I need an additional line- After Line:
I need to look at col. AA, IF a cell in AA is blank and col. Y on the same row begins w/ ~P then copy the values from AA and AB 1 cell below into the blank cells.
So AA7 is blank and Y7 begins w/ ~P, Copy the values from AA8 and AB8 to AA7 and AB7.
Full Code:
Thanks--
Doug
Code:
Cells(i + 1, "AC").Value = 1998
So AA7 is blank and Y7 begins w/ ~P, Copy the values from AA8 and AB8 to AA7 and AB7.
Full Code:
Code:
LRow = ws1.Cells(Rows.Count, 1).End(xlUp).Row
ws1.Range("y5:z" & LRow).Copy
ws1.Range("y5:z" & LRow).PasteSpecial Paste:=xlPasteValues
For i = Cells(Rows.Count, "D").End(xlUp).Row To 3 Step -1
If Cells(i, "D") = "NEED PARENT" 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)),""NEED PARENT"",""""))"
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
Next i
Thanks--
Doug