IsNumeric

Public Function IsNumeric(ByVal Expression As Variant) As Boolean

Returns True if the specified expression is a number or is a string that 'looks like a number'.

SendDebug IsNumeric(1) 'Prints True
SendDebug IsNumeric(3.14159) 'Prints True
SendDebug IsNumeric(True) 'Prints False
SendDebug IsNumeric(Now) 'Prints False
SendDebug IsNumeric("") 'Prints False
SendDebug IsNumeric("3") 'Prints True
SendDebug IsNumeric("3,5") 'Prints False, comma not allowed in number, only dot
SendDebug IsNumeric("3.14159") 'Prints True
SendDebug IsNumeric("-1.1") 'Prints True
SendDebug IsNumeric("-1.1.1") 'Prints False. Invalid number
SendDebug IsNumeric("-1.1e3") 'Prints True. Evaluates to -1100
SendDebug IsNumeric("-1.1e3.1") 'Prints False. Invalid number
SendDebug IsNumeric("&h22") 'Prints False.
SendDebug IsNumeric("0x22") 'Prints False.

See also: