|
- Sub test()
- Dim r%, i%
- Dim arr, brr(65 To 68)
- With Worksheets("sheet1")
- r = .Cells(.Rows.Count, 1).End(xlUp).Row
- .Range("g2:g" & r).ClearContents
- arr = .Range("a2:g" & r)
- For i = 1 To UBound(arr)
- Erase brr
- For j = 2 To 6
- If arr(i, j) Like "[ABCD]" Then
- x = Asc(arr(i, j))
- brr(x) = brr(x) + 1
- End If
- Next
- If brr(67) >= 3 Or brr(68) >= 2 Or (brr(67) >= 1 And brr(68) >= 1) Then
- arr(i, 7) = "不合格"
- Else
- arr(i, 7) = "合格"
- End If
- Next
- .Range("g2").Resize(UBound(arr), 1) = Application.Index(arr, 0, 7)
- End With
- End Sub
复制代码 |
评分
-
1
查看全部评分
-
|