VBA Math Functions

VBA Math Functions

VBA Math Functions:

VBA Math Functions help us to perform arithmetic operations and complex mathematical operations. These are Abs, Atn, Cos, Exp, Fix, FormatNumber, FormatCurrency, FormatPercent, Int, Log, Randomize, Rnd, Round, Sgn, Sin, Sqr, Tan, etc. These functions are Built-In functions. We can use these VBA Math & Trig functions in either procedure or function. These functions we use in the VBA editor window in Excel. These Mathematical functions you can use any number of times in VBA macro codes.

List of Math Functions in Excel VBA:

Here are the list of Math functions. And also find its description, syntax and return type. We can use these multiple Math and Trig functions in one statement.

Function Description Syntax Return Type
VBA Abs VBA Abs function returns an absolute value of a number. Abs(Number) Variant
VBA Atn VBA Atn function returns the arctangent of a number in radians, not degrees. Atn(Number) Double
VBA Cos VBA Cos function returns the cosine value of an angle in radians. Cos(Number) Double
VBA Exp VBA Exp function returns an exponential value for a specified number. Exp(Number) Double
VBA Fix VBA Fix returns the integer portion of a number. Fix(Number) Double
VBA FormatNumber FormatNumber(Expression,[NumDigitsAfterDecimal],[IncludeLeadingDigit],[UseParentsForNegativeNumbers],[GroupDigits]) String
VBA FormatCurrency FormatCurrency(Expression,[NumDigitsAfterDecimal],[IncludeLeadingDigit],[UseParentsForNegativeNumbers],[GroupDigits]) String
VBA FormatPercent FormatPercent(Expression,[NumDigitsAfterDecimal],[IncludeLeadingDigit],[UseParentsForNegativeNumbers],[GroupDigits]) String
VBA Int VBA Int function rounds a specified number down to an integer. Int(Number) Double
VBA Log VBA Log function returns the natural logarithm of a specified number. Log(Number) Double
VBA Randomize Randomize([Number]) N/A
VBA Rnd Rnd([Number]) Single
VBA Round Round(Number,[NumDigitsAfterDecimal]) Double
VBA Sgn Sgn(Number) Integer
VBA Sin Sin(Number) Double
VBA Sqr Sqr(Number) Double
VBA Tan Tan(Number) Double

List of VBA Functions:

Please click on below link to go back to see all List of VBA Functions.

List of VBA Functions

Leave a Comment

Your email address will not be published. Required fields are marked *