Hi All
Im creating a macro which inserts formulas and then autofill the column to last the last row. All formulas works except this one:
Range("J2").Select
ActiveCell.FormulaR1C1 = _
"=IF(RC[28]="""",IF(RC[-1]=""Complete"",RC[-3]+IFERROR(VLOOKUP(CONCATENATE(RC[-2],""-"",RC[-5],""-"",,RC[-4]),MasterData!C[-9]:C[-4],6,FALSE),""""),IF(RC[1]="""","""",IF(RC[-3]="""","""",IF(IFERROR(VLOOKUP(C[-6],'Priority Sheet'!C[-9]:C[-6],3,FALSE),0)>0,VLOOKUP(C[-6],'Priority Sheet'!C[-9]:C[-6],3,FALSE),RC[-3]+IFERROR(VLOOKUP(CONCATENATE(RC[-2],""-"",RC[-5],""-"",,MasterData!C1:C6,6,FALSE),""""))))),RC[28])"
Selection.AutoFill Destination:=Range("J2:J" & lastRow)
This would give the 1004 error: "Application-defined or Object-defined error"
Can anyone help med understand why it dosent work?
Thanks in advance!
Im creating a macro which inserts formulas and then autofill the column to last the last row. All formulas works except this one:
Range("J2").Select
ActiveCell.FormulaR1C1 = _
"=IF(RC[28]="""",IF(RC[-1]=""Complete"",RC[-3]+IFERROR(VLOOKUP(CONCATENATE(RC[-2],""-"",RC[-5],""-"",,RC[-4]),MasterData!C[-9]:C[-4],6,FALSE),""""),IF(RC[1]="""","""",IF(RC[-3]="""","""",IF(IFERROR(VLOOKUP(C[-6],'Priority Sheet'!C[-9]:C[-6],3,FALSE),0)>0,VLOOKUP(C[-6],'Priority Sheet'!C[-9]:C[-6],3,FALSE),RC[-3]+IFERROR(VLOOKUP(CONCATENATE(RC[-2],""-"",RC[-5],""-"",,MasterData!C1:C6,6,FALSE),""""))))),RC[28])"
Selection.AutoFill Destination:=Range("J2:J" & lastRow)
This would give the 1004 error: "Application-defined or Object-defined error"
Can anyone help med understand why it dosent work?
Thanks in advance!