Dim str As String 'Define a string varible Dim sum As Integer 'Define integer variable str = "32456" 'Set the string value For i = 0 To (str.Length - 1) 'i is your increment counter, the for loop increases i by one each loop sum = sum + Integer.Parse(str.Chars(i)) 'Extract the character at position i and convert it to an integer data type and add it to the sum Next