小班编号2

小班编号2

Sub xyf()

 

Dim arr As New Collection
Dim lindi_arr As New Collection
maxnban = 0
maxban = 0
i = 1
Do While Cells(i, 1).Value <> ""
arr.Add Cells(i, 1).Value
If arr(i) < 8000 Then
lindi_arr.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 lindi_arr.Count Step 1
If maxban < lindi_arr(i) Then
maxban = lindi_arr(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

posted on 2018-01-27 22:26 lbsjs 阅读(...) 评论(...) 编辑 收藏

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值