将string转换为ASCII码
我正在尝试使用Excel VBA编写一个函数来将string转换为其各自的ASCII编号。 例如:
"ABCD" => "65666768"
我已经写了这个代码,但没有做转换:
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
这条线
asciien = asciien & CStr(Asc(Mid(s, x, 1)))
应该读
asciien = asciien & CStr(Asc(Mid(s, i, 1)))
“x”没有价值