Get Absolute Value Method
The Get Absolute Value method returns the absolute value of the value that the number argument contains. The data type of the return value matches the data type of the value in the number argument. This method does the following:
If the value is a string variant type, then it converts the return value to a double variant type.
If the value is an empty variant type, then it converts the return value to a long variant type.
For more information, see Variants.
Format
Abs(number)
The following table describes the arguments that you can use with this method.
Argument | Description |
---|---|
number |
Any valid numeric expression. |
Example
The following example determines the difference between the oldacct variable and the newacct variable:
Sub Button_Click
Dim oldacct, newacct, count
oldacct = 1234566
newacct = 33345
count = Abs(oldacct - newacct)
End Sub