这是我的vba代码:
Sub Macro1()
Dim lastrow As Long
lastrow = 13
Range("AB" & CLng(lastrow) + 5).Select
ActiveCell.FormulaR1C1 = "=SUM(J2:J" & CLng(lastrow) & ")-SUM(AB2:AB" & CLng(lastrow) & ")"
End Sub
我想知道单元格输出为什么有''吗?
答案 0 :(得分:1)
应该是。
Sub Macro1()
Dim lastrow As Long
lastrow = 13
Range("AB" & CLng(lastrow) + 5).Select
ActiveCell.Formula = "=SUM(J2:J" & CLng(lastrow) & ")-SUM(AB2:AB" & CLng(lastrow) & ")"
End Sub