IsNumber

Public Function IsNumber(ByVal Expression As Variant) As Boolean

Returns True if the specified variable/expression is of a number type (Long, Double, LongLong or Decimal). Returns False for all other types, including for strings containing number like expressions and Date.

For testing if a String contains a number-like value, use IsNumeric.

Dim lVariant As Variant

lVariant = "3.14159"
SendDebug IsNumber(lVariant) ' Sends out 'False': lVariant is of type String and not of a Number type.

lVariant = Val(lVariant)
SendDebug IsNumber(lVariant) ' Sends out 'True': lVariant now contains the number 3.14159 (a double)

See also: