#2
东海ECS2023-04-25 18:46
|
这句好像不起作用,因为结果crr总是1-20,这20个数据不变(本程序在vba中运行正常)。
请老师修改一下,谢谢!
Private Sub Command24_Click()
Dim t$
t = Timer
Dim d As Object, arr(), brr, drr, crr, i As Long, j As Long, k As Long, m As Long, s, ke, n As Long
Dim sy
Set d = CreateObject("scripting.dictionary")
For i = 1 To 80 Step 8
If Form2.VSFlexGrid1.TextMatrix(i, 3) <> "" Then
crr = ""
For m = i To i + 7
brr = Split(Trim(Form2.VSFlexGrid1.TextMatrix(m, 3)))
For j = 0 To UBound(brr)
If Not d.Exists(brr(j)) Then d.add brr(j), ""
Next j
Next m
For k = 1 To 20
If Not d.Exists(k) Then
crr = crr & " " & k
End If
Next k
MsgBox crr
If MsgBox("确认要退出?", vbYesNo) = vbYes Then End
Else
Exit For
End If
d.RemoveAll
Next i
MsgBox Timer - t
End Sub
[此贴子已经被作者于2023-4-25 18:32编辑过]