ISNUMERIC(expression)

Returns the value True or False depending if the expression contains a number (Boolean).


expressionThe expression to test.

REMARKS
* The "expression" can be any numeric or string expression.
* If "expression" contains a date expression, then it returns False.
* This function is used a lot to test if a text string can be converted to a number.
* You can use the ISARRAY function to return True or False depending if the value is an array.
* You can use the ISDATE function to return True or False depending if the value is a date.
* You can use the ISERROR function to return True or False depending if the value is an error.
* You can use the ISNULL function to return True or False depending if the value contains no data.
* The equivalent .NET function is Microsoft.VisualBasic.Information.IsNumeric
* For the Microsoft documentation refer to docs.microsoft.com

Debug.Print IsNumeric(123) ' True  
Debug.Print Not IsNumeric(123) ' False
Debug.Print IsNumeric(10.23) ' True
Debug.Print IsNumeric("123") ' True
Debug.Print IsNumeric("-100") ' True
Debug.Print IsNumeric("100-") ' True
Debug.Print IsNumeric("100.") ' True
Debug.Print IsNumeric("01/12/2012") ' False
Debug.Print IsNumeric("20/12/2012") ' False
Debug.Print IsNumeric("12/20/2012") ' False
Debug.Print IsNumeric("12/01/2012") ' False
Debug.Print IsNumeric(#1/12/2012#) ' False
Debug.Print IsNumeric("abc") ' False

© 2019 Better Solutions Limited. All Rights Reserved. © 2019 Better Solutions Limited Top