不算太难,可以试试,留你邮箱。。。
可以了,你自己再微调下,下班啦
Sub Test1()
Dim Cnt1, Cnt2 As Integer
Dim i, j, j0, k As Integer
i = 2
j = 2
Cnt1 = Cells(2, 12)
Do While Cnt1 <> ""
j0 = j
Cnt2 = 0
Do While Cnt2 < Cnt1
Cnt2 = Cnt2 + Cells(j, 4)
j = j + 1
Loop
If Cnt2 = Cnt1 Then
For k = j0 To j
Cells(k, 3) = Cells(i, 9)
Next k
End If
If Cnt2 > Cnt1 Then
Cells(i, 13) = "未分配"
j = j - 1
End If
i = i + 1
Cnt1 = Cells(i, 12)
Loop
End Sub
317403844@qq.com