I am trying to apply a formula to a column in and I get an "expected end of statement error"
Sub Test()
Range("T2:T").FormulaR1C1 = "=IF($D2= "EMMEGI SCA 550 SMALL SAW","OK","Not OK")"
End Sub
when the error pops up EMMEGI is highlighted
>Solution :
You need to use Double Quotes when creating formulas with VBA:
Range("T2:T").FormulaR1C1 = "=IF($D2=""EMMEGI SCA 550 SMALL SAW"",""OK"",""Not OK"")"