# VBA ABS Function

HomeVBA TutorialTop VBA FunctionsVBA ABS Function

Table of Content

The VBA ABS function is listed under the math category of VBA functions. When you use it in a VBA code, it returns an absolute number in the result. In simple words, it returns a non-negative number that means if you specify a negative number it will remove its sign and returns it in the result.

Abs(Number)

## Arguments

• Number: The number which you want to convert into an absolute value (number).

## Example

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

``````Sub example_ABS()
Range("B1").Value = Abs(Range("A1"))
End Sub``````

In the above example, we have used the value from the cell A1 where we have a negative number (-1029) and then we have used the ABS function to convert that value into an absolute number and enter that value in the cell B1.

So basically when you run this code it simply takes the value from the cell A1 and converts it into an absolute number.