Adding a Number and Formula Text and Evaluating

  • Thread starter Thread starter obrien234
  • Start date Start date
O

obrien234

I have two separate cells. One is a number, for example cell B1 with a value
of 0.109. The other, B2, is in the format "* A1". I'm trying to combine the
two cells so they will display the value of "0.109 * A1", where A1 is a
reference to the cell A1. I've copied these cells from another program and
Excel does not seem to recognize that the text "* A1" works in a formula.
I've tried using a formula like

B1&B2
or
B1+B2

but the formatting is not correct and excel just displays the function
without evaluating it to the number it should represent. Any suggestions?

thank you
 
Use this UDF which you would copy to a general module in your workbook.

Function EvalCell(RefCell As String)
Application.Volatile
EvalCell = Evaluate(RefCell)
End Function

With 0.109 in B1 and 100 in A1 and * A1 in C1 enter in D1

=EvalCell(B1 & C1) return 10.9


Gord Dibben MS Excel MVP
 
Back
Top