首页 > 其他 > 详细

小班编号2

时间:2018-01-27 22:57:11      阅读:234      评论:0      收藏:0      [点我收藏+]

Sub xyf()

 

Dim arr As New Collection
Dim arr1 As New Collection
maxnban = 0
maxban = 0
i = 1
Do While Cells(i, 1).Value <> ""
arr.Add Cells(i, 1).Value
If arr(1) < 8000 Then
arr1.Add Cells(i, 1).Value
End If
If maxnban < arr(i) Then
maxnban = arr(i)
End If
i = i + 1
Loop

For i = 1 To arr1.Count Step 1
If maxban < arr1(i) Then
maxban = arr1(i)
End If
Next

arrconut = arr.Count


Cells(1, 2).Value = arr(1)

For i = 1 To arrconut Step 1
If i = arrconut Then
Exit For
End If
fban = arr(i)
sban = arr(i + 1)
If fban <> sban Then
Cells(i + 1, 2).Value = sban
End If
If fban = sban Then
If fban >= 8000 Then
maxnban = maxnban + 1
Cells(i + 1, 2).Value = maxnban
Else
maxban = maxban + 1
Cells(i + 1, 2).Value = maxban
End If
End If
Next

End Sub

小班编号2

原文:https://www.cnblogs.com/lbsjs/p/8367461.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!