|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
你输入的代码有问题,数字1变成小写字母L了
- Sub 求和()
- Dim i As Long
- Dim j As Long
- i = Cells(Rows.Count, "A").End(xlUp).Row
- If Cells(i, 1) <> "合计" Then
- i = i + 1
- Cells(i, 1) = "合计"
- End If
- Cells(i, "C") = i - 3
- With Cells(i, 4).Resize(1, 10)
- .FormulaR1C1 = "=SUM(R[-" & i - 3 & "]C:R[-1]C)"
- .Value = .Value
- End With
- Intersect(Range("F:G,K:K"), Rows(i)).ClearContents
- Cells(i + 1, "D") = "平均"
- Cells(i + 1, "E") = Application.Average(Range("e3:e" & i))
- Cells(i + 1, "E").NumberFormat = Cells(3, "E").NumberFormat
- End Sub
复制代码 |
|