View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
bpeltzer bpeltzer is offline
external usenet poster
 
Posts: 180
Default Calculate Formula

You need to do something to get the input string evaluated. Something like
the following (some error checking would be nice, but I'll leave that for
you;-) ):

Dim result As Double
ActiveSheet.Shapes("Answer").Select
result = Evaluate(Box1)
Selection.Characters.Text = Box1 & " = " & result

HTH. --Bruce

"Naz" wrote:

Hi all,

I need to create a simple calculater in Excel for kids. I can create forms
and add a box to enter the calculation. But how do i get Excel to evaluate
the contents of the box and show the answer?

I have a text box called box1 where the user enters the calc (1+2, 24/5 so on)
and then a label on the form called answer.
I thought that Answer=Box1 would work but it just give a duplicate of the
calc entered.

I know i should be able to do this but i just can't figure it.

All help is appreciated



--

_______________________
Naz,
London