VarType (VBScript Function)

The VarType() function is used to determine the data type of a given variable in VBScript. It accepts one parameter (the variable in question) and returns an integer representing the data type of the variable. A full list of return types for VarType() can be found on the data types page for VBScript.

Code Snippet

Dim MyVar

MyVar = 12
If VarType(MyVar) = vbInteger Then
    MsgBox("MyVar is an Integer")
    MsgBox("MyVar is not an Integer")
End If
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License