How I can calculate the value of string "120+150+120... etc"

S

StanUkr

Hello, All
In A1 cell I have a text string like "120+130", sometimes more numbers
to plus... Could you advice me what formula should I use to replace
this with already summarized value. I've tried to use formula "="&A1
but it returnes text value "=120+130"...
thanx for assistance
 
S

StanUkr

I need to calculate a summ just with the help of a function... the
massive of data is too large to insert "=" manualy....
text to column is also not suitable for my purpose...

--
Kind regards,

Niek Otten

in message
 
V

vezerid

Use this VBA function:

Function eval(s As String)
eval = Application.Evaluate("=" & s)
End Function

Then you can use this in a cell as:

=eval(A1)

To install,
Alt+F11 to go to the VBA editor.
Insert | Module
Paste the above code.
Ready to use

HTH
Kostis Vezerides
 
S

StanUkr

vezerid said:
Use this VBA function:

Function eval(s As String)
eval = Application.Evaluate("=" & s)
End Function

Then you can use this in a cell as:

=eval(A1)

To install,
Alt+F11 to go to the VBA editor.
Insert | Module
Paste the above code.
Ready to use

HTH
Kostis Vezerides

Thank U! that's exatcly what i need! Custom formula was the best
solution here...
 
S

StanUkr

vezerid said:
Use this VBA function:

Function eval(s As String)
eval = Application.Evaluate("=" & s)
End Function

Then you can use this in a cell as:

=eval(A1)

To install,
Alt+F11 to go to the VBA editor.
Insert | Module
Paste the above code.
Ready to use

HTH
Kostis Vezerides

Thank U! that's exatcly what i need! Custom formula was the best
solution here...
 
J

Jim May

So how is it that I can end up getting #NAME?
Always the "black-cloud-following-me", it seems...
 
Top