To work around this behavior, use either A1 style references or named references exclusively.
The following examples illustrate how to insert a formula into a cell without receiving a #NAME? error value.
Example Using A1 Style Reference
Sub makeFormulaA1Ref()
With ActiveSheet
.TransitionFormEntry = True
.Range("A1").Value = 1
.Range("A2").Value = 2
.Range("A3").Formula = "=sum(A1,A2)"
.TransitionFormEntry = False
End With
End Sub
Example Using a Named Reference
Sub makeFormulaNamedRef()
With ActiveSheet
.TransitionFormEntry = True
.Range("A1").Value = 1
.Range("A1").Name = "P3D"
.Range("A2").Value = 2
.Range("A2").Name = "P4D"
.Range("A3").Formula = "=sum($P3d,$P4D)"
.TransitionFormEntry = False
End With
End Sub