vb 循环的问题

来源:百度知道 编辑:UC知道 时间:2024/06/28 17:51:40
Private Sub Command15_Click()
Dim str1 As String, c As String
Dim arr() As String
Dim ii As Integer, hh As Integer, y As Integer
Dim a(1 To 12) As String
Dim count(7 To 12) As Long
Dim s As Integer
Dim i As Long, j As Long, k As Long, m As Long
Dim h As String

For ii = 0 To List2.ListIndex
str1 = List2.List(ii)
arr = Split(str1, ",")

For i = 0 To 11
a(i + 1) = arr(i)
Next
For y = 1 To MSFlexGrid1.Rows - 1
s = MSFlexGrid1.TextMatrix(y, 1)
c = s

If Len(c) = 3 And IsNumeric(c) And InStr(1, c, "-") = 0 And InStr(1, c, ".") = 0 And InStr(1, c, "E") = 0 Then
For k = 1 To 3
For j = 7 To 12
If InStr(1, a(j), Mid(c, k, 1)) <> 0 Then count(j) = count(j) + 1
Next j
Next k
For m =

1、 在 MSFlexGrid1.TextMatrix(y, hh + ii) = h
后面加上
Erase count
h = ""
就OK了
2、你想赋值h给临时变量TEMP,代码也加在MSFlexGrid1.TextMatrix(y, hh + ii) = h 后面。
3、你又让 h=Temp 干什么?

哎,头都大了。。。

第一行?什么意思,是不是第一次循环的意思?
你把对s的定义放在模块内不就完了?