|
不用字典的程序
- Sub test3()
- Dim r%, i%
- Dim arr, brr%(), crr%(), zrr()
- With Worksheets("sheet3")
- r = .Cells(1, 1).End(xlDown).Row
- arr = .Range("a2:h" & r)
- m = 0
- xm = ""
- For i = 1 To UBound(arr)
- If xm <> arr(i, 1) Then
- m = m + 1
- ReDim Preserve zrr(1 To 2, 1 To m)
- zrr(1, m) = i
- zrr(2, m) = i
- xm = arr(i, 1)
- Else
- zrr(2, m) = i
- End If
- Next
- ReDim brr(1 To 3)
- For k = 1 To UBound(zrr, 2)
- ReDim crr(1 To 3)
- For j = 6 To 8
- For i = zrr(1, k) To zrr(2, k)
- If arr(i, j) > 80 Then
- crr(j - 5) = 1
- End If
- Next
- Next
- For j = 1 To 3
- brr(j) = brr(j) + crr(j)
- Next
- Next
- .Range("f39").Resize(1, 3) = brr
- End With
- End Sub
复制代码 |
评分
-
1
查看全部评分
-
|