Sub test()
Dim i%, c%
For i = 26 To 10 Step -1
If Cells(i, 7) = Cells(28, 6) Then
c = c + 1
End If
Next
[G28] = c
End Sub
for i=10 to 26
If cells(i,6)=cells(28,6) then
c=c+1
End if
Next
for i=26 to 1 step -1
if cells(i,7)=cells(28,6) then exit for
next
[g28]=26-i
Sub 结果输出()
Dim i As Integer, c As Integer
For i = 26 To 10 Step -1
c = c + 1
If Cells(i, 7) <> Cells(28, 6) Then Exit For
Next
MsgBox c - 1
End Sub