Reputation: 439
I want to insert the following formula to a cell
Range("Q12").FormulaR1C1 = "=If(P12>1,1,P12)"
but my output in the cell is below
=WENN('P12'>1;1;'P12')
the problem is it includes ' ' . Please help me to correct this problem
Thanks
Upvotes: 0
Views: 57
Reputation: 96753
Use the non-R1C1 format:
Sub hfdjs()
Range("Q12").Formula = "=If(P12>1,1,P12)"
End Sub
Upvotes: 2