Dim ch(26)
Private Sub Command1_Click()
x = InputBox("请输入要查询的字母")
For i = 0 To 25
If UCase(x) = ch(i) Then
MsgBox x & "是数组中第" & i + 1 & "个元素"
Exit For
End If
Next i
End Sub
Private Sub Form_Load()
For i = 0 To 25
ch(i) = Chr(65 + i)
Next i
End Sub