# How to use the VBA ATN Function (Syntax + Example)

HomeVBA Functions LIST (Category Wise)How to use the VBA ATN Function (Syntax + Example)

The VBA ATN function is listed under the math category of VBA functions. When you use it in a VBA code, it can return the arctangent of a number that you supplied. In simple words, arctangent is used to calculate the angles of a right triangle and ATN returns it for the number you specified.

Table of Content

Atn(Number)

## Arguments

• Number: The number which you for which you want to calculate the arctangent.

## Example

To practically understand how to use VBA ATN function, you need to go through the below example where we have written a vba code by using it:

``````Sub example_ATN()
Range("B1").Value = Atn(Range("A1"))
End Sub``````

In the above example, we have used the value from the cell A1 where we have a number for which we want to calculate the arctangent and then we have used the ATN to convert that value into an absolute number and enter that value in the cell B1.