ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Formula, not results showing (https://www.excelbanter.com/excel-programming/294053-formula-not-results-showing.html)

bruce forster

Formula, not results showing
 
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.

Brad Vontur[_2_]

Formula, not results showing
 
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.

Ian Coates[_3_]

Formula, not results showing
 
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

--

Remove NG from my address to send direct.
-----

"bruce forster" wrote in message
...
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").Select
If Range("A1").Value = "Input" Then Range("F2").Formula = "C2 + C3"
If Range("A1").Value = "% of Rev" Then Range("F2").Formula = "C2*.5"
End Sub

Thanks.





All times are GMT +1. The time now is 10:16 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com