Hello,
I'm trying to record a very long formula and copy it down to the end of data(row 1).
The formula works in Excel but I can't get to execute after I record it.
Here is my code, please help.
Thanks, Lenna
I'm trying to record a very long formula and copy it down to the end of data(row 1).
The formula works in Excel but I can't get to execute after I record it.
Here is my code, please help.
Thanks, Lenna
Code:
Columns("R:R").Select
Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
Range("R1").Select
ActiveCell.FormulaR1C1 = "OrderStatus"
Range("R2").Select
ActiveCell.FormulaR1C1 = _
"=CHOOSE(IF(RC[-5]="""",1,2),IF(AND(RC[-1]<>""AT1R"",RC[-1]<>""LCTI"",RC[-1]<>""LPRI"",RC[-1]<>""LPRI_RPT"",RC[-1]<>""LPRII"",RC[-1]<>""LPRII_RPT"",RC[-1]<>""SABI_Dilution"",RC[-1]<>""SABII_Dilution"",RC[-1]<>""GP__I"",RC[-1]<>""GP__IDv2"",RC[-1]<>""GP__IDv1"",RC[-1]<>""GP__II"",RC[-1]<>""GP__MICA""),""NoOrderNumberFound"",""TestNotReported""),IF(ISERROR(VLOOKUP(RC[-" & _
"1,FALSE)),""WrongTestOrdered"",""CorrectTest""))"
FinalRow = Cells(Rows.Count, 1).End(xlUp).Row
Range("R2").Copy
Range("R2:R" & FinalRow).Select
ActiveSheet.Paste