Formula, not results showing

B

bruce forster

I have typed the following code and when executed the formula shows in the cell not the number. What do I do?

Public Sub FormulaTest_Click(
Range("E2").Selec
If Range("A1").Value = "Input" Then Range("F2").Formula = "C2 + C3
If Range("A1").Value = "% of Rev" Then Range("F2").Formula = "C2*.5
End Su

Thanks.
 
B

Brad Vontur

Make sure you include the equals sign in the formula property, just like a regular formula.. "=C2+C3

----- bruce forster wrote: ----

I have typed the following code and when executed the formula shows in the cell not the number. What do I do?

Public Sub FormulaTest_Click(
Range("E2").Selec
If Range("A1").Value = "Input" Then Range("F2").Formula = "C2 + C3
If Range("A1").Value = "% of Rev" Then Range("F2").Formula = "C2*.5
End Su

Thanks.
 
I

Ian Coates

You need = before the formula otherwise Excel sees it a text.

If Range("A1").Value = "Input" Then Range("F2").Formula = "=C2 + C3"
If Range("A1").Value = "% of Rev" Then Range("F2").Formula = "=C2*.5"

HTH

Ian

--
[email protected]
Remove NG from my address to send direct.
-----

bruce forster said:
I have typed the following code and when executed the formula shows in the
cell not the number. What do I do??
 
Top