IsNumeric Function

Purpose

Returns a Boolean value indicating whether an expression can be evaluated as a number.

Syntax

Bool = IsNumeric(exp)

exp: any expression

Description

IsNumeric returns True if the expression is a Variant containing a numeric expression, a numeric expression, or a string expression.

IsNumeric returns False if expression is a date expression.

Example

Debug.Show

Local a As Variant, b#, c$

a = #22.12.1900#

Trace IsNumeric(a) //  0

b = 2222

Trace IsNumeric(b) // True

c = "10000"

Trace IsNumeric(c) // -1

c = "Hallo"

Trace IsNumeric(c) //  0

Remarks

IsNumeric tests whether the expression can be converted using OLE functions, which are language dependent (slower).

See Also

Val?, IsDate, IsEmpty, IsError, IsMissing, IsNull, IsNumeric, IsObject

{Created by Sjouke Hamstra; Last updated: 10/10/2014 by James Gaite}