|
楼主 |
发表于 2012-3-17 23:09
|
显示全部楼层
TTTTT 发表于 2012-3-17 23:05
也许我没有说清楚,点击一下这个按钮:
刚才别人给我了一段代码,能帮忙解释一下吗?
- Sub yy()
- Dim Arr, i&, r1, n&
- Sheet1.Activate
- [e4:e30].ClearContents
- Arr = [a1].CurrentRegion
- For i = 3 To UBound(Arr)
- Set r1 = [d:d].Find(Arr(i, 1), , , 2)
- If Not r1 Is Nothing Then
- n = r1.Row
- If Cells(n, 5) = "" Then
- Cells(n, 5) = Arr(i, 2)
- Else
- Do
- n = n + 1
- If Cells(n, 5) = "" Then
- Cells(n, 5) = Arr(i, 2): Exit Do
- End If
- Loop While Cells(n, 5) <> ""
- End If
- End If
- Next
- End Sub
|
|