VB Convert String to Number: CInt, CDbl, CLng Guide

You can use the CInt() function to convert a string to an integer, the CDbl() function to convert a string to a double precision floating point number, and the CLng() function to convert a string to a long integer data. For example:

Dim str As String
Dim num As Integer

str = "123"
num = CInt(str)

In this example, convert the string “123” to an integer and store it in the variable num.

bannerAds