Excel: Fix Function (VBA only)
In Excel, the Fix function returns the integer portion of a number.
The syntax for the Fix function is:
Fix( expression )
expression is a numeric expression whose integer portion is returned.
Note:
If the expression is negative, the Fix function will return the first negative number that is greater than or equal to the expression.
Applies To:
- Excel 2007, Excel 2003, Excel XP, Excel 2000
For example:
Fix(210.67) would return 210 Fix(2.98) would return 2 Fix(-2.98) would return -2
VBA Code
The Fix function can only be used in VBA code. For example:
Dim LNumber As Double
LNumber = Fix(210.67)
In this example, the variable called LNumber would now contain the value of 210.
