jksmurf,
I haven't checked your equation, but Excel and VBA have different operator
precedence, wrt Negation and Exponentiation.
Maybe the reason why Excel works, but VBA fails.
NickHK
"jksmurf" wrote in
message ...
I'm stumped. I have a simple calculation in a Macro which results in a
-ve number.
Gr = ((1 - 2 / a) / (1 + x * sqr(2 / (a - 4)))) ^(1 / 3)
I did a watch on a and x, they are 191 and -21.
The error is " Run-time error '5' Invalid procedure call or argument "
Oddly, if I perform the SAME calc in the Worksheet it works FINE. It
just fails in VBA?
Any ..um ... hints?
k.
--
jksmurf
------------------------------------------------------------------------
jksmurf's Profile:
http://www.excelforum.com/member.php...o&userid=29564
View this thread: http://www.excelforum.com/showthread...hreadid=492644