excel vba 怎么求平均值,求和
答案:1 悬赏:60 手机版
解决时间 2021-02-14 11:51
- 提问者网友:凉末
- 2021-02-13 23:29
excel vba 怎么求平均值,求和
最佳答案
- 五星知识达人网友:野味小生
- 2021-02-13 23:35
Sub 求和()
For i = 1 To [b65536].End(3).Row
Cells(i, "q") = Application.Sum(Range("b" & i & ":o" & i))
Cells(i, "r") = Application.Average(Range("b" & i & ":o" & i))
Next
End Sub追问1、怎么能让他有公式,不仅仅得出数值
2、求平均值时有某几列是空行,怎么跳过呢?追答Sub 求和()
For i = 1 To [b65536].End(3).Row
Cells(i, "q") = "=Sum(b" & i & ":o" & i & ")"
Cells(i, "r") = "=Average(b" & i & ":o" & i & ")"
Next
End Sub
For i = 1 To [b65536].End(3).Row
Cells(i, "q") = Application.Sum(Range("b" & i & ":o" & i))
Cells(i, "r") = Application.Average(Range("b" & i & ":o" & i))
Next
End Sub追问1、怎么能让他有公式,不仅仅得出数值
2、求平均值时有某几列是空行,怎么跳过呢?追答Sub 求和()
For i = 1 To [b65536].End(3).Row
Cells(i, "q") = "=Sum(b" & i & ":o" & i & ")"
Cells(i, "r") = "=Average(b" & i & ":o" & i & ")"
Next
End Sub
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯