|
Sub 整理()
Dim ar As Variant
Dim br()
Set sh = Sheets("题目答案")
With sh
r = .Cells(Rows.Count, 1).End(xlUp).Row
If r < 2 Then MsgBox "题目答案为空!": End
ar = .Range("a1:a" & r)
End With
With Sheets("整理")
.UsedRange = Empty
zf = 1
For i = 1 To UBound(ar)
If ar(i, 1) = "待检查" Then
zf = zf & "|" & i + 1
End If
Next i
If zf = 1 Then MsgBox "没有待检查标识!": End
zf = zf & r
rr = Split(zf, "|")
For i = 0 To UBound(rr) - 1
ks = rr(i)
js = rr(i + 1)
n = n + 1
.Cells(n, 1) = ar(ks, 1)
y = 1
For s = ks + 1 To js
If sh.Cells(s, 1).Interior.ColorIndex = 6 Then
y = y + 1
.Cells(n, y) = ar(s, 1)
End If
Next s
Next i
End With
MsgBox "ok!"
End Sub
|
|