使用Excel的函数SUM()来计算求和列并填充。示例代码如下:
Dim lastRow As Integer lastRow = Cells(Rows.Count, "A").End(xlUp).Row
Range("C2:C" & lastRow).Formula = "=SUM(A2:B2)" '将A2和B2相加并填充至C2 Range("C2:C" & lastRow).Value = Range("C2:C" & lastRow).Value '将公式转换为值
上一篇:automaticallyeditrepowebhookuponcreation
下一篇:Automaticallyimplementatraitforatypethatalreadysatisfiesit