using formulas in a combo box


Posted by Charline on December 28, 2001 2:53 PM

we are trying to get formulas to show up in a drop down box so that when you choose a formula, it calculates and places the returned value in that cell.
Can this be done? I have gotten the formulas to show up in the box by using '=8*8 to force it as text, but then it will not calculate because it is text.

Any ideas would be greatly appreciated.

Charline



Posted by Bariloche on December 28, 2001 5:09 PM

Charline,

You aren't going to like this, but I can't duplicate your "problem."

I created a list of "formulas" (=1*1 thru =12*12) and put them in a combo box (they display as =1*1, etc). Then I used the combo box's change event to put the value of the combo box in a cell on the spreadsheet and it calculated properly (that cell now contains the formula =1*1, the result, 1, is displayed).

Are you sure the cell you are putting the value in is not formatted as text? Near as I can tell the single quote that you used to get your formulas to display has no bearing on the situation.

See if you can reformat the cell you are trying to "write" to. Baring that, put the result into a different cell and see if it will calculate.

If that doesn't work post back, maybe with more specifics on what your macro does. Could be that something else isn't right.


good luck