如果UCase(c)转换出来的为空NULL,空的会包这样的错。给st = Text1.SelText中的Text1赋个0值.
n = Asc(UCase(c)) - Asc("A") + 1
在这句话 下面Private Sub Command2_Click() 加上:
Dim c(1000) as String
c (i)= Mid(st, i, 1)
Private Sub Command2_Click()
Dim a(26) As Integer
Dim c As String '加这句试试