Does VBA have an ATan2 function?

前端 未结 4 1941
独厮守ぢ
独厮守ぢ 2021-01-20 00:27

I\'d like to calculate atan2 in VBA, but I\'m not sure if that function exists (or even where to find a canonical list of built-in VBA functions). I\'m not usi

4条回答
  •  不思量自难忘°
    2021-01-20 01:02

    To get a list, type into your module

    VBA.Math
    

    Or use the object browser. You will find Atn and Tan, amongst others, but the list is quite short and ATan2 is not included.

    If you wish to add a reference to an Excel library, you can use:

    Excel.WorksheetFunction.Atan2
    

    EDIT: You can call Excel worksheet functions from any Office application that allows you to add a reference to the Excel libraries. This does not mean using Excel or a worksheet, just the function.

提交回复
热议问题