Is the type of a numeric value of a cell in Excel ALWAYS considered as DOUBLE?
excel, vba
Solution
Reference - http://www.cpearson.com/excel/rounding.htm
Excel stores numbers differently that you may have them formatted display on the worksheet. Under normal circumstances, Excel stores numeric values as "Double Precision Floating Point" numbers, or "Doubles" for short. These are 8-byte variables that can store numbers accurate to approximately 15 decimal places. You may have only two decimal places displayed on the worksheet, but the underlying value has the full 15 decimal places.
Hence if you're reading a number from a cell, there's really no reason to use anything but a Double.
Problem
In VBA, as this specification shows, numeric values can have several types: Double, Integer, Long, LongLong, Single, Decimal, Byte. However, it seems that in Excel, for a cell containing a numeric value, its type is always considered as Double. There are several functions, either in Excel formula or VBA code, which can check data type of a cell. For instance, TypeName Function in VBA, TYPE function in Excel, IS functions in Excel, etc. But it seems that the finest type they can return for a numeric value is Double, other numeric types (Integer, Long, Byte...) can never be detected. Could anyone tell me if I am right/wrong?