Thank you Norie, that is excellent, I actually came up with this after discovering the debug command, it's almost identical, but it is good to get verification.
Option Explicit
Sub Test()
TestNum (Range("A1"))
End Sub
Function TestNum(s As String)
Dim i As Integer
Dim x As Integer
Dim y As Integer
y = 0
For i = 1 To Len(s)
x = Asc(Mid$(s, i, 1))
If x <> 32 Then
y = y + x
Debug.Print "The value of variable I is: " & i
Debug.Print "The value of variable S is: " & s
Debug.Print "The value of variable X is: " & x
Debug.Print "The value of variable Y is: " & y
End If
Next i
Range("D1") = y
End Function
Bookmarks