[英]How do i tell a cell to contain the sum of a entire row in excel
I would like to tell an excel sheet to put, for each row, the sum of the values between B and G cells in the H cell. 我想告诉一个excel工作表,为每一行放置H单元中B和G单元之间的值之和。
For exemple: H1 must contain the SUM(B1:G1)
, H2 must contain SUM(B2:G2)
... 例如:
H1 must contain the SUM(B1:G1)
, H2 must contain SUM(B2:G2)
...
I want to make this process automatic instead of specifying on each H cell that is the SUM of the corresponding values between B and G. 我想使此过程自动化,而不是在每个H单元中指定B和G之间的对应值的总和。
Thanks. 谢谢。
If you double-click the little black box in the bottom-right hand corner of the cell, excel will automatically replicate the contents of that cell to the bottom of your current list revelant to the cell references within the cell. 如果双击单元格右下角的小黑框,Excel会自动将该单元格的内容复制到当前列表的底部,该列表与该单元格中的单元格引用有关。 You can also click-and-drag the little black box to specify the range yourself
您也可以单击并拖动小黑框以自行指定范围
This block will fill the entire acvitvated sheet when ran. 运行时,此块将填充整个已填充的图纸。
Sub FillSums
Dim I as Integer
I=0
While Err.Description = ""
I=I+1
Application.ActiveSheet.Range("H" & I).Formula = "=SUM(B" & I & ":G" & I & ")"
Wend
End Sub
Dim I as Integer
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.