|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
Sub qs()
arr = Split(Sheet1.[a17].Value, "、")
x = Val(Sheet1.[b17].Value)
ReDim brr(1 To x, 1 To UBound(arr) + 1)
ReDim crr(1 To x, 1 To 1)
For i = 0 To UBound(arr)
sm = 0: cl = cl + 1
For j = 1 To x
If x = j Then
brr(j, cl) = arr(i) - sm
Else
brr(j, cl) = Application.WorksheetFunction.Round(arr(i) / x, 1)
sm = sm + brr(j, cl)
End If
Next
Next
For i = 1 To UBound(crr)
crr(i, 1) = brr(i, 1) & "、" & brr(i, 2) & "、" & brr(i, 3)
Next
Sheet1.Range("f2").Resize(x, 1) = crr
End Sub |
|