Returns the result of explicitly converting an expression to a specified data type, object, structure, class, or interface.
CType(expression, typename)
CType is compiled inline, meaning the conversion code is part of the code that evaluates the expression. Execution is faster because there is no call to a procedure to accomplish the conversion.
This example uses the CType function to convert an expression to the specified data type.
Dim MyNumber As Long Dim MyNewType As Single MyNumber = 1000 MyNewType = CType(MyNumber,Single) ' MyNewType is set to 1000.0.