|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
- Sub kdy()
- arr = Range("a2:a" & Cells(Rows.Count, 1).End(xlUp).Row)
- Dim brr(1 To 999, 1 To 1)
- For l = 1 To UBound(arr)
- x = Application.WorksheetFunction.RoundUp(arr(l, 1) / 11, 0)
- For i = 12 To 18
- If x > Application.WorksheetFunction.RoundUp(arr(l, 1) / i, 0) Then
- x = Application.WorksheetFunction.RoundUp(arr(l, 1) / i, 0)
- End If
- Next
- y = Int(arr(l, 1) / x)
- Z = arr(l, 1) Mod y
- For j = 1 To Z
- w = "+" & y + 1 & w
- Next
- For k = 1 To x - Z
- v = "+" & y & v
- Next
- p = w & v
- brr(l, 1) = Mid(p, 2, 999)
- w = ""
- v = ""
- Next
- Range("b2").Resize(UBound(arr)) = brr
- End Sub
复制代码
这个没问题了 |
评分
-
1
查看全部评分
-
|