[英]Excel VBA Sum Function
我在vba中的行總和公式有問題。 我正在使用以下代碼。 當我檢查Range("H3").Formula
的值給我正確的值=SUM(C5:G5)
但是問題是它沒有反映在excel單元中。
Range("H3").Formula = "=SUM(" & Range(Cells(5, 3), Cells(5, 7)).Address(False, False) & ")"
您需要完全限定單元格(注意點)。 嘗試這個
'~~> Replace this with the relevant sheet
With Sheets("Sheet1")
.Range("H3").Formula = "=SUM(" & _
.Range(.Cells(5, 3), .Cells(5, 7)).Address(False, False) & _
")"
End With
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.