我需要将L列的总数加起来,我知道第一行和最后一行:
lRow = Cells(Rows.Count, 2).End(xlUp).Row
fRow = Cells(lRow, "B").Value
那么如何在我的SUM中使用lRow
和fRow
?
答案 0 :(得分:3)
activecell.Formula = "=SUM(L" & lrow & ":L" & frow & ")"
编辑 - 已添加:
Sub Assign
dim dbl_assign as long
lRow = Cells(Rows.Count, 2).End(xlUp).Row
fRow = Cells(lRow, "B").Value
activecell.Formula = "=SUM(L" & lrow & ":L" & frow & ")"
dbl_assign = activecell.value
end sub