Q:

Calculate in Function

underlying is a part of a bigger code I am writing. I simplified the problem in this example Function. The 'Formuletekst' can change i.e. "*" or "/' or something else. How can I write the Function in order to have the calculated value (10) for test instead of the output "500/50" which it gives in this example function? Many thanks!
Amir
'IN this case Formuletekst = "/"
Function TT(FormuleTekst)
teg = Formuletekst
TT = 500 & teg & 50
End Function

A:

I would rather suggest to use the Application.Evaluate method, to make sure to catch every string that might be an expression:
tt = "500/50"
aa = Application.Evaluate(tt)

aa will be equal to 10, and this will happen for every kind of Excel operation you might pass into the function. 
The evaluate method is the best way to manage this kind of input that are "strings" but at the same time "human readable operations".
Other example to show you a more complex input that wouldn't be managed by the other alternative you've been proposed: 
tt = "500/50 + 10/20 - 4"
aa = Application.Evaluate(tt)

This input will return aa = 6.5, but I believe parsing the string and performing the operation would be much longer to implement (and not safer anyway, if the built-in exists already). 
So, my suggestion is just to write
TT = Application.Evaluate("500" & teg & "50")

