Numbers


Dim number As Variant 
If (INT(number) = number) Then
End

If (INT(number)/number = 1) Then
End

If (TypeName(number) = "Integer") Then
End


If a variable needs to contain a whole number you can use Integer or Long.
If a variable needs to contain a fraction you can use Single, Double or Currency.


Floating Point Numbers

These are numbers that can be expressed as mm E ee, where mm is the mantissa and ee is the exponent (power of 10).



Removing Decimal Places



Returning Remainder


Using VBA
12.6 Mod 5 = 3


Application.Pi

Only available in Excel
Excel

Application.Pi 


Avoid using floating-point data types. The Currency datatype is in fact faster than using the Single datatype because it doesn't use the floating point processor.




© 2017 Better Solutions Limited. All Rights Reserved. © 2017 Better Solutions Limited

Next