|
5#
楼主 |
发表于 2008-12-9 14:12:23
|
只看该作者
Private Sub asdfas_AfterUpdate()
Dim intCount As Integer, H As Integer
Dim I As Integer, J As Integer, K As Integer
Dim strArray() As String
If intCount = Len(Me.asdfas) Then
If intCount Mod 2 <> 0 Then
MsgBox "请输入偶数位的数据"
End If
End If
H = intCount / 2 - 1
ReDim strArray(H)
For I = 0 To intCount - 2 Step 2
strArray(J) = Mid(Me.asdfas, I + 1, 2)
J = J + 1
Next
K = UBound(strArray)
For I = 0 To K
For J = 0 To K
If I <> J Then
If strArray(I) = strArray(J) Then
MsgBox strArray(I) & " 有重复"
Exit Sub
End If
End If
Next
Next
End Sub
我改成这样,出现错误“运行错误9,下标越界”···ReDim strArray(H)这句变黄了
[ 本帖最后由 forman 于 2008-12-9 14:13 编辑 ] |
|