Method: IsNumeric for VBS
- Updated2024-09-12
- 1 minute(s) read
Methods > Method: IsNumeric for VBS
Method: IsNumeric for VBS
Specifies whether an expression is a number.
vIsNumeric = Object.IsNumeric(expression)
Object | VBS Object with this method. You do not need to specify this object. |
expression | Variant Specifies any expression. |
vIsNumeric | Variant The method IsNumeric returns True if the expression is a number. Otherwise the method returns False. |
The following example checks whether a variable is a number:
Dim MyVar MyVar = 4711 Call MsgBox(IsNumeric(MyVar)) ' Returns True MyVar = "4711" Call MsgBox(IsNumeric(MyVar)) ' Returns True MyVar = "No.4711" Call MsgBox(IsNumeric(MyVar)) ' Returns False