+ Reply to Thread
Results 1 to 3 of 3

why does atan2 not work??

Hybrid View

  1. #1
    jaison
    Guest

    why does atan2 not work??

    i would like to use atan2(x,y) in my program but i get an error: "Sub or
    function not defined". i try to use atn but it yeild the wrong result.

  2. #2
    Chip Pearson
    Guest

    Re: why does atan2 not work??

    ATAN2 is not a VBA function -- it is an Excel function.
    Therefore, you have to call it via Application.WorksheetFunction.
    E.g.,

    res = Application.WorksheetFunction.Atan2(x, y)


    --
    Cordially,
    Chip Pearson
    Microsoft MVP - Excel
    Pearson Software Consulting, LLC
    www.cpearson.com


    "jaison" <[email protected]> wrote in message
    news:[email protected]...
    >i would like to use atan2(x,y) in my program but i get an error:
    >"Sub or
    > function not defined". i try to use atn but it yeild the wrong
    > result.




  3. #3
    Bernard Liengme
    Guest

    Re: why does atan2 not work??

    Also, do remember computer work with angles in radians not degrees
    See Help for functions RADIANS and DEGREES
    best wishes
    --
    Bernard V Liengme
    www.stfx.ca/people/bliengme
    remove caps from email

    "jaison" <[email protected]> wrote in message
    news:[email protected]...
    >i would like to use atan2(x,y) in my program but i get an error: "Sub or
    > function not defined". i try to use atn but it yeild the wrong result.




+ Reply to Thread

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