Results 1 to 16 of 16

Cube Root of a Negative Number fails in VBA?

Threaded View

  1. #1
    Registered User
    Join Date
    12-12-2005
    Posts
    5

    Cube Root of a Negative Number fails in VBA?

    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 other ... um ... hints?

    k.

    1. I already had a thought to send it back to the worksheet and then kuludging it back to the macro.
    2. Also have implemented a -ve if statement check and multiplied by -1 if <0, then cube root that and return it to a -ve. Still a kludge though.
    Last edited by jksmurf; 12-12-2005 at 03:35 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1