View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
joel joel is offline
external usenet poster
 
Posts: 9,101
Default Excel Formulas Treated as Strings

Range("B2").formula = "=5*Chgval(B1)"

"cjes" wrote:

I am trying to create a formula through code.

I am managing to do this but in the actual cell the formula is not being
calculated. It is being treated as text.
Ex.
In cell B1 i have a value of 500
I want to create a formula showing 500 *5 in cell b2.

in cell b2 I am calling a function ChgVal(B1). The result in B2 is correctly
showing =500*5 but it is not showing the value 2500.
I also tried using the VALUE command but to no avail.
Can anyone pls help?
Thanks