|
发表于 2013-12-21 14:56
|
显示全部楼层
本楼为最佳答案
本帖最后由 Zipall 于 2013-12-21 14:58 编辑
- Sub test()
- arr = Range("A2").CurrentRegion
- n = 2
- Range("g2:h65536").ClearContents
- For r = 2 To UBound(arr)
- t = Split(arr(r, 1), "-")(0)
- With Cells(n, 6)
- .Value = t
- .AutoFill .Resize(arr(r, 2))
- .Offset(, 1).Resize(arr(r, 2)).Value = 1
- .Offset(, 2).Resize(arr(r, 2)).Value = arr(r, 3) / arr(r, 2)
- End With
- n = n + Cells(r, 2).Value
- Next
- End Sub
复制代码 |
|