I insert this formula through VBA,
Cells(1, 1).FormulaR1C1 = "=LEFT(A2;5)"
But the formula which gets inserted ends up with apostrophes.
=LEFT('A2';5)
This works perfectly with the R1C1 notation, but not with the A1 type.
Super User is a question and answer site for computer enthusiasts and power users. It only takes a minute to sign up.
Sign up to join this communityUsing .Formula
instead of .FormulaR1C1
solved the problem.
Cells(1, 1).Formula = "=LEFT(A2;5)"