ISNUMERIC

ISNUMERIC(expression)

Returns the value True or False depending if the expression is 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 CSTR function to return an expression converted to a String data type.
* 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 ISEMPTY function to return True or False depending if the variable has been initialised.
* You can use the ISERROR function to return True or False depending if the value is an error.
* You can use the ISMISSING function to return True or False depending if an optional argument has been passed in.
* You can use the ISNULL function to return True or False depending if the value contains no data.
* You can use the ISOBJECT function to return True or False depending if the variable represents an object.
* The equivalent .NET function is [[Microsoft.VisualBasic.Information.IsNumeric]]
* For the Microsoft documentation refer to learn.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

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