HI ,
I am trying to run my code , but it suddenly gives an error when at the last formula.
The mentioned formula works corectlly in excel and the R1C1 is build via print Activecell.FormulaR1C1.
How can I correct it?
MY formul ain excel = =IFNA(INDEX('RMS WELCOME'!C:M,MATCH(E3,'RMS WELCOME'!C:C,0),10),"NO PO's")
I am trying to run my code , but it suddenly gives an error when at the last formula.
The mentioned formula works corectlly in excel and the R1C1 is build via print Activecell.FormulaR1C1.
How can I correct it?
MY formul ain excel = =IFNA(INDEX('RMS WELCOME'!C:M,MATCH(E3,'RMS WELCOME'!C:C,0),10),"NO PO's")
Code:
Sub forfill()
Dim MYR As Range
Dim llastrow As Variant
Sheets("My INT").Activate
lastrow = Cells(rows.Count, "P").End(xlUp).row
Range("P3:P" & [lastrow]).FormulaR1C1 = "=IFNA(INDEX('RMS WELCOME'!C[-13]:C[-3],MATCH(RC[-11],'RMS WELCOME'!C[-13],0),7),0)"
Range("Q3:Q" & [lastrow]).FormulaR1C1 = "=IFNA(INDEX('RMS WELCOME'!C[-14]:C[-4],MATCH(RC[-12],'RMS WELCOME'!C[-14],0),8),0)"
Range("R3:R" & [lastrow]).FormulaR1C1 = "=IFNA(INDEX('RMS WELCOME'!C[-15]:C[-5],MATCH(RC[-13],'RMS WELCOME'!C[-15],0),9),0)"
[COLOR=#ff0000]Range("S3:S" & [lastrow]).FormulaR1C1 = "=IFNA(INDEX('RMS WELCOME'!C[-16]:C[-6],MATCH(RC[-14],'RMS WELCOME'!C[-16],0),10),"NO PO's")"[/COLOR]
End Sub