I am trying to write a function using Excel VBA to convert a string to its respective ASCII number. For example:
"ABCD" => "65666768"
I have written this code but it's failed to do the conversion:
Public Function asciien(s As String) As String
' Returns the string to its respective ascii numbers
   Dim i As Integer
   For i = 1 To Len(s)
      asciien = asciien & CStr(Asc(Mid(s, x, 1)))
   Next i 
End Function
 
     
    